Modify

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#23414 closed defect (fixed)

Geotagged images dialog tries to load image from closed layer

Reported by: GerdP Owned by: team
Priority: normal Milestone: 23.12
Component: Core image mapping Version:
Keywords: template_report Cc: taylor.smock

Description

What steps will reproduce the problem?

  1. Start JOSM with clean home dir
  2. open new data layer
  3. drag&drop a geo referenced image (in my case DSC_4901.JPG)
  4. click on the icon for that image so that the image is shown (DSC_4901.JPG appears in the tile)
  5. delete the layer "Geotagged images", note that the image dialog stays open but DSC_4901.JPG is no longer in the title
  6. press 'y' to hide the image dialog
  7. press 'y' again

What is the expected result?

After step 5 I would expect that the image dialog is closed since there are no more images to show
After step 7 I would expect that nothing happens since no image layer exists

What happens instead?

The image dialog pops up empty, but with DSC_4901.JPG in the title

Please provide any additional information below. Attach a screenshot if possible.

I think this is caused by a memory leak. org.openstreetmap.josm.gui.layer.geoimage.ImageViewerDialog.MoveImgDisplayPanel keeps a reference to the deleted GeoImageLayer.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2024-01-03 16:22:55 +0100 (Wed, 03 Jan 2024)
Revision:18934
Build-Date:2024-01-04 02:31:00
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18934 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 294 MB / 1972 MB (143 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_DE
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, -DXss50k, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\HWConsole.exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (36196)
+ RoadSigns (36196)
+ apache-commons (36176)
+ buildings_tools (36200)
+ comfort0 (36200)
+ o5m (36126)
+ pbf (36176)
+ poly (36126)
+ reltoolbox (36200)
+ reverter (36196)
+ undelete (36126)
+ utilsplugin2 (36200)

Validator rules:
+ c:\josm\core\resources\data\validator\combinations.mapcss
+ c:\josm\core\resources\data\validator\geometry.mapcss
+ c:\josm\core\resources\data\validator\relation.mapcss
+ c:\josm\core\resources\data\validator\unnecessary.mapcss
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1

Last errors/warnings:
- 00000.572 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.574 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00000.969 E: java.security.KeyStoreException: Windows-ROOT not found. Cause: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available

Attachments (1)

23414.patch (1.6 KB ) - added by GerdP 5 months ago.
work in progress

Download all attachments as: .zip

Change History (7)

comment:1 by GerdP, 5 months ago

I don't know where exactly the memory leak is but I would expect this:
When I close the last "GeoTagged images" layer JOSM should free the memory for the popup dialog and the layer and then behave as before the first image layer was loaded, means, the 'y' action should be disabled or at least doing nothing.

by GerdP, 5 months ago

Attachment: 23414.patch added

work in progress

comment:2 by GerdP, 5 months ago

See patch in #23415 which also fixes this problem.

comment:3 by GerdP, 5 months ago

Resolution: fixed
Status: newclosed

In 18937/josm:

fix #23415 and #23414, patch 23415-v2.patch

  • fixes issues where the wrong image is shown
  • properly destroys the toggle dialog and the toggle action when no more geotagged image layer is available
  • make sure that the title is updated when no image is selected (instead of possibly showing an image name from a closed layer

comment:4 by taylor.smock, 5 months ago

Milestone: 23.12

comment:5 by GerdP, 5 months ago

A lot of unit tests fail :(
Are they all caused by my change?

comment:6 by skyper, 5 months ago

Component: CoreCore image mapping

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.