Closed GHolk closed 2 months ago
FWIW, I've run across many TIFFs of this type. Its format is known as "Old-style JPEG", that is its Compression tag equals 6. There has been much disagreement over this format's description in the TIFF spec, and I've seen these TIFF formatted two different ways. It does not open in many TIFF readers that I've come across, including macOS Preview.
The only way that I have found to reliably open this type of TIFF is to ignore the TIFF tags whenever the Compression Tag (259 or 0x103) equals 6, and extract the JPEG that's inside. I do this by searching for the string 'JFIF' in the byte array, backing up 6 bytes to the start of the JPEG, and reading from there to the end of the array. That technique works for this image. Unfortunately I don't have code for this in JavaScript. The images I deal with are fetched from a server, and that code is written in Java.
It should be fixed now, both in Photopea and in UTIF.js
This TIFF file scaned with grayscale option in my office's scaner. It displays correctly on windows, but photopea and UTIF.js decode it wrong.
If the tiff file decoded correctly, it should look like this:
But photopea (and UTIF) decode it like this:
The grayscale tiff in zip: my-newspaper.zip
This bug does not bother me very much, but it seem that there are a lot of scaners which can produce TIFF in this format. Maybe it is worthy to fix.
PS: Imagick show this message while convert this tiff to jpeg: