Mismatch between default directories for TIFF saveAs and openImage

When I run IJ.saveAs ('image_name_without_path') my
images get saved (as far as I can tell) to $HOME (running ubuntu).
When I run IJ.openImage ('image_name_without_path')
normally it tries to open the image from $HOME. But if it’s a TIFF
image, it tried to open it from root ("/").

Here is a test script:

from ij import IJ

imp1a = IJ.createImage ('image1', '8-bit ramp', 256, 256, 1)
IJ.saveAs (imp1a, 'PNG', 'image1.png')   # saves to $HOME
imp1b = IJ.openImage ('image1.png')      # works -- opens from $HOME
imp1b.show()  # works

imp2a = IJ.createImage ('image2', '8-bit ramp', 256, 256, 1)
IJ.saveAs (imp2a, 'TIFF', 'image2.tif')   # saves to $HOME
imp2b = IJ.openImage ('image2.tif')       # fails -- tries to open from root ("/")
imp2b.show()  # fails with "AttributeError: 'NoneType' object has no attribute 'show'"
# but works if I copy image2.tif to / (root)

When I run the script, the second open fails with the following
message box:

“Open TIFF”
“/image2.tif (No such file or directory)”

If I copy the missing file from $HOME to root, then the script runs.

(I get the same results with both the most recent auto-update, 1.52p,
and the most recent daily build, 1.52r33.)

Thanks, mm

1 Like

This bug is fixed in the latest ImageJ daily build (1.52r38).

Hello Wayne -

I can confirm that ImageJ now reads “no file path” .tif files
from $HOME (on ubuntu) with the latest daily build (1.52r38).

(Marked as solved.)

Thanks, mm