Login  Register

Re: Why are images automatically renamed?

Posted by Gabriel Landini on Oct 07, 2010; 9:43pm
URL: http://imagej.273.s1.nabble.com/Why-are-images-automatically-renamed-tp3686678p3686683.html

On Thursday 07 October 2010 20:28:22 Norbert Vischer wrote:
> two subjects, and my favorite scenarios would be:
> if I "Open" an image file, then:
> a) if it is already open, it should be brought
>    to the front rather than a copy being opened
>
> b) if it is not open yet, but some other window happens
>    to have the same title, it should still open with its
>    original file name rather than being renamed-
>    even if now two images have the same name.

Hi Norbert,
How can one differentiate between cases a) and b)?
How will plugins (and users) resolve the exact duplicate names in b)?

> Still the user can explicitely duplicate in IJ or the Finder/Explorer.

Sure, but those duplicate images have to be identifiable by their titles
somehow, as plugins use the titles to process the images.

> My main concern is that my plugin relies on path names when handling
> images. I want to be sure that the path name of an image remains valid
> after being opened.

Maybe you can resolve this in a different way. For example open the image, and
rename it with a reserved name that is unlikely to exist.
Or get the list of all the open images to check whether the image in the path
you chose corresponds to an image already open, and give a warning.
Or the plugin could just close all open images at start (similar to the Close
All command).

> Gabriel, I made experiments with other applications (Word,
> GraphicConverter, BBEdit, PowerPoint); they all behave logical as
> described in a) and b). ImageJ is an exception.

Yes, but not all programs do so. The GIMP opens new copies of the same image
with -1.0, -2.0 and so on, similarly to IJ.


Regards

Gabriel