corewall / corelyzer

The Corelyzer Core Visualization Tool
http://corewall.org
13 stars 6 forks source link

images with same session/segment/filename but different path don't reflect changes unless you clear image cache #34

Open dsilas opened 2 years ago

dsilas commented 2 years ago

Dear @sorghumking

Thank you for maintaining this excellent software! Version 2.1.2 built from source for Ubuntu 20.01 The building process was not too difficult.

However I have found a problem which confused me for a while.

I made a session and imported my images. Then I used imagemagick to attach a ruler to rescale all my core images, since they were not photographed with one though the lengths were recorded(it makes things easier to pinpoint when using corelyzer). I resaved these new images in a new folder. Then I treid both adding them to my new session and creating a new session with them.

The images have the same filenames as images already used for another corelyzer session, but in a different folder so with different paths. Basically Corelyzer will not reflect any changes in the images, unless you change the filenames or until you delete the image cache within corelyzer and reload the images!

i tried loading from subdirectory where the first images were, and also a subdirectory in /tmp, i tried resaving them with gimp, exporting them, etc. The only thing that made a difference was saving under a new filename not already used by corelyzer in a previous session, or by erasing the image cache from within corelyzer.

It seems like corelyzer image cache doesn't consider paths, only filenames or session/sectuib names.

STEPS TO REPRODUCE:

  1. Take an image of a core, call it TEST1-1.jpg for example. Now open corelyzer without any sessions loaded
  2. load TEST1-1.jpg in corelyzer via Ctl + M command
  3. go through the dialogs view it in corelyzer
  4. Now close the session
  5. in gimp/photoshop, make some scribbles over the TEST1-1.jpg core image and resave it.
  6. Repeat steps 2-3
  7. Observe that the image does not reflect the changes you made
  8. Clear image cache from the corelyzer edit menu
  9. repeat steps 2-3
  10. Observe that the image does reflect the changes.
sorghumking commented 2 years ago

Hello @dsilas, delighted to hear you're using Corelyzer, especially on Linux!

Regarding image caching, you are correct. This is expected behavior.

Corelyzer caches imagery based on the filename only. The assumption is that a core image's file name matches the core's identity, which should be unique.

In the Edit > Preferences... dialog, select the Directories tab and note the Image Cache path. That directory contains a folder for each cached image, named to match the image file. These folders can be manually deleted if you want to re-cache a subset of your images (vs. deleting the entire cache through the Edit > Clear Image Cache... menu item).

If you want multiple images for a single core, our standard practice is to add a descriptive suffix to the image filename to prevent name collisions in the cache. For instance, a darker exposure of the original GLAD4-HST03-1C-1H-1.jpg file would be named GLAD4-HST03-1C-1H-1_darker.jpg.