BUG: TIFF photos can't be opened in the image viewer
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
Since #1532, PictoPy imports .tif/.tiff files and they show up fine in the gallery grid. But clicking one opens the image viewer with a broken-image icon instead of the photo. JPG photos open normally.
Steps to reproduce
- Add a folder containing a
.tifimage and a.jpgimage - Both show up on Home with correct thumbnails
- Click the
.jpg→ opens in the viewer normally - Click the
.tif→ the viewer shows a broken-image icon instead of the photo
Screenshots
Screenshots:(1) both photos import with correct thumbnails, (2) the .jpg opens normally in the viewer.
(3) the .tif shows a broken-image icon in the viewer
Record
- [x] I agree to follow this project's Code of Conduct
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
@rohan-pandeyy if this is considered a valid issue, can I work on it ?
⚠️ Potential Duplicate Issue (Semantic Match)
This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:
-
BUG: "Open Original File" button in Media Info Panel shows no action (#1165, closed) https://github.com/AOSSIE-Org/PictoPy/issues/1165 Similarity: 71.4%
-
BUG: Open Folder Button in Image Viewer Does Nothing (#959, closed) https://github.com/AOSSIE-Org/PictoPy/issues/959 Similarity: 67.6%
-
BUG: Open folder and open original file button donot work in image viewer (#1017, open) https://github.com/AOSSIE-Org/PictoPy/issues/1017 Similarity: 63.5%
Please review before proceeding.
Hi @rohan-pandeyy, I'd like to work on this issue.
I reproduced the cause: the grid shows JPEG thumbnails, but the viewer loads the original file into an , which the webview can't decode for TIFF. (The pending HEIC support in #1577 doesn't touch the viewer, so HEIC would likely hit the same problem.)
I have a fix ready locally and will wait for assignment before opening a PR:
- new GET /images/{image_id}/preview in the backend. The path is read from the DB by id, and it returns a JPEG (16-bit, CMYK, palette and multi-page TIFFs handled)
- the viewer uses it for .tif/.tiff and still loads everything else straight from disk
- http://localhost:52123 added to the CSP img-src so the viewer can show the preview
- 11 backend and 5 frontend tests; the full suites pass
Two questions: are on-the-fly previews fine, or would you prefer cached copies? And should .heic/.heif be added to the same path once #1577 merges?
Could you please assign this to me?
Hi @Arnab I am already working on it please pick another issue. Thank you for understanding 🙏