Multi-page TIFF files can't be opened, although they are shown as import thumbnails and scale is correctly extracted
The attached image is a multi-page TIFF. (3 out of 5 pyrrhocoris files I received were multi-page.)
When creating a project or importing photos, it is correctly found, its import thumbnail is generated and the scale marker can be automatically extracted (not sure from which page; they look similar).
However, when the user double-clicks the Scale
cell in the import table to open the window to set the scale manually (the first occasion when the photo would be displayed full-size), the application crashes in debug mode:
setting "projects_folder" to C:\MAPHIS\Projects
calling import_dialog.handle_assign_global_tag_toggled(False)
calling import_dialog.handle_infer_tags_toggled(True)
scale rec left = 1
width > height
width > height
Traceback (most recent call last):
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\import_dialog.py", line 284, in handle_double_click_on_table
self._scale_set_widget.image_viewer.set_photo(photo, True)
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\image_viewer.py", line 199, in set_photo
layer.set_photo(photo, reset_tool=reset_tool)
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\photo_layer.py", line 60, in set_photo
img = qimage2ndarray.array2qimage(photo.image)
File "C:\Users\Karel\miniconda3\envs\arth2\lib\site-packages\qimage2ndarray\__init__.py", line 365, in array2qimage
raise ValueError("array2qimage can only convert 2D or 3D arrays "
ValueError: array2qimage can only convert 2D or 3D arrays (got 4 dimensions)
Process finished with exit code 1
This could be handled either by supporting multi-page TIFFs (perhaps with a warning that only the first (?) page would be used), or by not using and offering them for import at all (perhaps with a warning that an unusable file has been found).
(The file was too big to upload here, so the archive needed to be split in two. Can be extracted e.g. with 7zip.) Pyrrhocoris3-etac2.zip.001 Pyrrhocoris3-etac2.zip.002