﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23574	[Patch]Preference geoimage.viewer.centre.on.image=true is ignored on startup	GerdP	team	"==== What steps will reproduce the problem?
1. Make sure that preferences.xml contains `<tag key='geoimage.viewer.centre.on.image' value='true'/>`
2. Start JOSM
3. Open background image layer (e.g. Bing)
4. Drag & drop some geotagged images which have different geo locations
5. Open one of the images 
6. Click on the buttons to show further images
7. Click on the ""Centre View"" button
8. Click on the ""Centre View"" button again
==== What is the expected result?
View should be centred to the location of the image without any click on the ""Centre View"" button
==== What happens instead?
View is not changed. I have to click twice (!) on the ""Centre View"" button to get the desired behaviour.
==== Please provide any additional information below. Attach a screenshot if possible.
This small patch fixes the problem:
{{{#!patch
Index: src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java        (revision 19020)
+++ src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java        (working copy)
@@ -229,8 +229,9 @@
         btnNext = createNavigationButton(imageNextAction, buttonDim);
         btnLast = createNavigationButton(imageLastAction, buttonDim);

+        centerView = Config.getPref().getBoolean(""geoimage.viewer.centre.on.image"", false);
         tbCentre = new JToggleButton(imageCenterViewAction);
-        tbCentre.setSelected(Config.getPref().getBoolean(""geoimage.viewer.centre.on.image"", false));
+        tbCentre.setSelected(centerView);
         tbCentre.setPreferredSize(buttonDim);

         JButton btnZoomBestFit = new JButton(imageZoomAction);
}}}
{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2024-03-12 17:31:19 +0100 (Tue, 12 Mar 2024)
Revision:19017
Build-Date:2024-03-13 02:30:59
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19017 en_GB) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19045)
Memory Usage: 297 MB / 1888 MB (55 MB allocated, but free)
Java version: 17.0.8+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: en_GB
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18789, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\HWConsole.exe]

Plugins:
+ FastDraw (36226)
+ OpeningHoursEditor (36226)
+ RoadSigns (36226)
+ SimplifyArea (36209)
+ apache-commons (36176)
+ buildings_tools (36226)
+ comfort0 (36200)
+ conflation (0.6.11)
+ jts (36004)
+ o5m (36126)
+ pbf (36176)
+ poly (36126)
+ reltoolbox (36226)
+ reverter (36230)
+ splinex (36126)
+ undelete (36226)
+ utilsplugin2 (36226)

Validator rules:
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1
+ c:\josm\core\resources\data\validator\geometry.mapcss

Last errors/warnings:
- 00000.739 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.742 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00001.183 E: java.security.KeyStoreException: Windows-ROOT not found. Cause: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
}}}
"	defect	closed	normal	24.03	Core image mapping		fixed	template_report	
