tiff compression (tiff: unsupported feature: compression value 7) #955

Closed
opened 2026-02-20 00:02:37 -05:00 by deekerman · 25 comments
Owner

Originally created by @ymgenesis on GitHub (May 20, 2021).

Originally assigned to: @lastzero on GitHub.

During photo indexing the logs return several errors regarding the formatting of some of my .tiff scanned images.

2021-05-20 10:14:23 WARN index: failed converting sample.tif to jpeg (tiff: unsupported feature: compression value 7)

2021-05-20 10:14:23 ERRO resample: can't open sample.tif

2021-05-20 10:14:23 INFO converting 2020/2020-12-31/sample.tif to jpg

Does this have anything to do with this stack overflow question?, mainly that photoprism will use libtiff to resample tiff to jpg, and that the 7 tag means the images use the JPEG ('new-style' JPEG) compression scheme, which isn't supported by default? If so, is it possible to add support for the JPEG ('new-style' JPEG) compression scheme? I have hundreds of them (scans of family history photos, docs, artifacts, etc), and was the main reason to install photoprism. I'd happily provide a sample that throws these errors.

Second, each time I add new photos to my library and go to index them in, it'll try to re-process these .tiff files, adding a fair chunk of time to indexing before getting to the new photos. Is there anything to help this, other than removing them from the index folder?

Originally created by @ymgenesis on GitHub (May 20, 2021). Originally assigned to: @lastzero on GitHub. During photo indexing the logs return several errors regarding the formatting of some of my .tiff scanned images. ``` 2021-05-20 10:14:23 WARN index: failed converting sample.tif to jpeg (tiff: unsupported feature: compression value 7) 2021-05-20 10:14:23 ERRO resample: can't open sample.tif 2021-05-20 10:14:23 INFO converting 2020/2020-12-31/sample.tif to jpg ``` Does this have anything to do with [this stack overflow question?](https://stackoverflow.com/questions/37827484/unsupported-tiff-compression), mainly that photoprism will use `libtiff` to resample tiff to jpg, and that the `7` tag means the images use the `JPEG ('new-style' JPEG)` compression scheme, which isn't supported by default? If so, is it possible to add support for the `JPEG ('new-style' JPEG)` compression scheme? I have hundreds of them (scans of family history photos, docs, artifacts, etc), and was the main reason to install photoprism. I'd happily provide a sample that throws these errors. Second, each time I add new photos to my library and go to index them in, it'll try to re-process these .tiff files, adding a fair chunk of time to indexing before getting to the new photos. Is there anything to help this, other than removing them from the index folder?
deekerman 2026-02-20 00:02:37 -05:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Go - the programming language we use - doesn't support all TIFF features. Don't think this is libtiff, which sounds like a C library.

@lastzero commented on GitHub (May 20, 2021): Go - the programming language we use - doesn't support all TIFF features. Don't think this is libtiff, which sounds like a C library.
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Since it's an error, the indexer tries to index them again.... you can for example use a .ppignore file to exclude them if you know this will never work or create JPEGs manually with a decoder that supports your feature set.

@lastzero commented on GitHub (May 20, 2021): Since it's an error, the indexer tries to index them again.... you can for example use a .ppignore file to exclude them if you know this will never work or create JPEGs manually with a decoder that supports your feature set.
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

You're welcome to send a feature request to the Go developer community. I'd be happy to implement this for you, but you see how long our todo list already is...

Alternatively we can use an external converter tool in a future release. Would be good if you can test which one works for you, ideally providing us with a list / comparison.

@lastzero commented on GitHub (May 20, 2021): You're welcome to send a feature request to the Go developer community. I'd be happy to implement this for you, but you see how long our todo list already is... Alternatively we can use an external converter tool in a future release. Would be good if you can test which one works for you, ideally providing us with a list / comparison.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

Where would I put the jpegs once I've created them? in the corresponding sidecar folder?

I'd imagine a streamlined solution would probably be best (no need to convert externally before indexing). Some of the .tifs work, maybe it was the specific scanner I used compressed them a specific way. I'll try making jpegs externally and place them in the sidecar folders and see what happens when I index again.

@ymgenesis commented on GitHub (May 20, 2021): Where would I put the jpegs once I've created them? in the corresponding sidecar folder? I'd imagine a streamlined solution would probably be best (no need to convert externally before indexing). Some of the .tifs work, maybe it was the specific scanner I used compressed them a specific way. I'll try making jpegs externally and place them in the sidecar folders and see what happens when I index again.
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Please put them next to the originals if you create them manually using the same name (prefix before the file extension). The sidecar path is for automatically created sidecar files to separate them, although technically it might work to put them there manually as well.

@lastzero commented on GitHub (May 20, 2021): Please put them next to the originals if you create them manually using the same name (prefix before the file extension). The sidecar path is for automatically created sidecar files to separate them, although technically it might work to put them there manually as well.
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Yes, it was probably the app that caused the special compression - maybe based on some settings. TIFFs are usually uncompressed and pretty large, that's their prime use case. Many camera RAW formats are also based on TIFF for this reason. If you want compression, you typically use JPG or PNG nowadays.

@lastzero commented on GitHub (May 20, 2021): Yes, it was probably the app that caused the special compression - maybe based on some settings. TIFFs are usually uncompressed and pretty large, that's their prime use case. Many camera RAW formats are also based on TIFF for this reason. If you want compression, you typically use JPG or PNG nowadays.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

Ya I specifically remember using tiff when scanning family history because I didn't want compression. It looks like my old scanner would use LZW compression without my knowledge. I think that's another issue, though. It returns a different error

photoprism | time="2021-05-20T15:20:17Z" level=info msg="converting 2019/2019-06-17/sample.tif to jpg"
photoprism | time="2021-05-20T15:20:17Z" level=error msg="resample: can't open sample.tif"
photoprism | time="2021-05-20T15:20:17Z" level=warning msg="index: failed converting sample.tif to jpeg (lzw: invalid code)"

I'll get back to you on creating jpegs for the sidecar folders. I'd rather try and place them in sidecar manually without messing up the structure/organization of my photo library. I can be stubborn about that :p

@ymgenesis commented on GitHub (May 20, 2021): Ya I specifically remember using tiff when scanning family history because I didn't want compression. It looks like my old scanner would use [LZW compression](https://www.prepressure.com/library/compression-algorithm/lzw) without my knowledge. I think that's another issue, though. It returns a different error ``` photoprism | time="2021-05-20T15:20:17Z" level=info msg="converting 2019/2019-06-17/sample.tif to jpg" photoprism | time="2021-05-20T15:20:17Z" level=error msg="resample: can't open sample.tif" photoprism | time="2021-05-20T15:20:17Z" level=warning msg="index: failed converting sample.tif to jpeg (lzw: invalid code)" ``` I'll get back to you on creating jpegs for the sidecar folders. I'd rather try and place them in sidecar manually without messing up the structure/organization of my photo library. I can be stubborn about that :p
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

It's good to have standard JPEGs (or even PNGs if you don't like compression) to archive family photos. Uncommon TIFF encodings might not be readable anymore in the future. In fact, already today.

@lastzero commented on GitHub (May 20, 2021): It's good to have standard JPEGs (or even PNGs if you don't like compression) to archive family photos. Uncommon TIFF encodings might not be readable anymore in the future. In fact, already today.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

Ya maybe I'm going overkill, but it does make sense to have a 'supreme quality' master at source so I can compress and send if needed. Thanks for the help I'll let you know how it goes.

@ymgenesis commented on GitHub (May 20, 2021): Ya maybe I'm going overkill, but it does make sense to have a 'supreme quality' master at source so I can compress and send if needed. Thanks for the help I'll let you know how it goes.
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

LZW was ringing a bell with me, it used to be patent protected. That's why open-source software typically doesn't support it anymore, not due to technical issues or laziness of the developers.

https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch#Patents

@lastzero commented on GitHub (May 20, 2021): LZW was ringing a bell with me, it used to be patent protected. That's why open-source software typically doesn't support it anymore, not due to technical issues or laziness of the developers. https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch#Patents
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

Question, how would I get photoprism to ignore all .tif/.tiff images, if I decide to convert them all to jpgs? I'll still keep the original .tifs in the library, but I'd just like photoprism to ignore that file extension. Can't seem to find instructions on using .ppignore. is it simply putting a .ppignore file in the originals folder with the text:

*.tiff
*.tif

Ah, I see it here.

@ymgenesis commented on GitHub (May 20, 2021): Question, how would I get photoprism to ignore all .tif/.tiff images, if I decide to convert them all to jpgs? I'll still keep the original .tifs in the library, but I'd just like photoprism to ignore that file extension. Can't seem to find instructions on using .ppignore. is it simply putting a .ppignore file in the originals folder with the text: ``` *.tiff *.tif ``` Ah, I see it [here](https://docs.photoprism.org/user-guide/library/indexing/#ignoring-directories-and-files).
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Yes

@lastzero commented on GitHub (May 20, 2021): Yes
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Won't affect already indexed files though

@lastzero commented on GitHub (May 20, 2021): Won't affect already indexed files though
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

Right, so to remove the .tifs that are there now, would I remove their .yml and .jpg in the sidecar folders?

@ymgenesis commented on GitHub (May 20, 2021): Right, so to remove the .tifs that are there now, would I remove their .yml and .jpg in the sidecar folders?
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

You'd need to remove all files and reindex. But you can also just the delete the tiffs and keep the JPEGs if you want to use those anyways.

@lastzero commented on GitHub (May 20, 2021): You'd need to remove all files and reindex. But you can also just the delete the tiffs and keep the JPEGs if you want to use those anyways.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

By remove all files, do you mean from the sidecar folder? Example if I want to remove sample.tif I would just find the folder it's in in sidecar and remove it along with its .yml. in my originals folder I just have the folders with nothing in them as I haven't imported anything. Would like to purge the photoprism library of the tifs I had indexed in, but keep the indexing I have done to this point (took a couple days).

@ymgenesis commented on GitHub (May 20, 2021): By remove all files, do you mean from the sidecar folder? Example if I want to remove sample.tif I would just find the folder it's in in sidecar and remove it along with its .yml. in my originals folder I just have the folders with nothing in them as I haven't imported anything. Would like to purge the photoprism library of the tifs I had indexed in, but keep the indexing I have done to this point (took a couple days).
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

The tiffs are your originals. Sidecar files alone won't get indexed, just if there is a matching original.

@lastzero commented on GitHub (May 20, 2021): The tiffs are your originals. Sidecar files alone won't get indexed, just if there is a matching original.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

I want to keep the tiffs in my organized photo library on disk (not photoprism). They'll be accompanied by jpgs. I'd like to remove (from photoprism) the tiffs that have been indexed into photoprism, and index in the jpgs that I've created from the tiffs. I've added the .ppignore to the originals folder. I understand it will only ignore tiffs moving forwards.

How do I make it so only the new jpgs I've created from my previous tiffs are the only versions of those photos in photoprism? About 20% of the tiffs didn't get indexed and returned the errors I mentioned before. The rest were converted and indexed in properly. I'm trying to get them out and make it jpgs across the board without removing the original tiffs from my photo library on disk (which is mounted for indexing in my docker-compose.yml file).

I appreciate your help!

@ymgenesis commented on GitHub (May 20, 2021): I want to keep the tiffs in my organized photo library on disk (not photoprism). They'll be accompanied by jpgs. I'd like to remove (from photoprism) the tiffs that have been indexed into photoprism, and index in the jpgs that I've created from the tiffs. I've added the .ppignore to the originals folder. I understand it will only ignore tiffs moving forwards. How do I make it so only the new jpgs I've created from my previous tiffs are the only versions of those photos in photoprism? About 20% of the tiffs didn't get indexed and returned the errors I mentioned before. The rest were converted and indexed in properly. I'm trying to get them out and make it jpgs across the board without removing the original tiffs from my photo library on disk (which is mounted for indexing in my `docker-compose.yml` file). I appreciate your help!
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

You forcefully want to remove working TIFFs from the index but keep related JPEGs? Does it hurt to keep them if they are OK and cause no errors? Otherwise maybe start with a fresh index database and use the ignore file from the start.

@lastzero commented on GitHub (May 20, 2021): You forcefully want to remove working TIFFs from the index but keep related JPEGs? Does it hurt to keep them if they are OK and cause no errors? Otherwise maybe start with a fresh index database and use the ignore file from the start.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

I have 500-1000 tiffs I want to organize into family history albums. A portion of them didn't index in properly, leaving my family history library in photoprism incomplete.

Instead of using logs to figure out which tiffs exactly weren't converted to jpg and indexed in properly when the original index ran, I'd like to remove all the tiffs and index in new jpgs of all 500-1000 tiffs. I'd like to keep the tiffs in my photo library on disk, utilizing .ppignore to ignore them in photoprism. I've already created the jpgs alongside the tiffs in my photo album. Folders look something like scan1.tif with an accompanying scan1.tif.jpg, etc. If I run the index again, the new .tif.jpgs will be indexed in, creating duplicates of the tiffs that did make it into photoprism. To remedy that I'd like to remove the original .tifs. I suppose I'll have to start the library from scratch again. I was hoping to remove the converted tifs and their .yml files from the sidecar folders, but I understand they'd still remain in the database.

@ymgenesis commented on GitHub (May 20, 2021): I have 500-1000 tiffs I want to organize into family history albums. A portion of them didn't index in properly, leaving my family history library in photoprism incomplete. Instead of using logs to figure out which tiffs exactly weren't converted to jpg and indexed in properly when the original index ran, I'd like to remove all the tiffs and index in new jpgs of all 500-1000 tiffs. I'd like to keep the tiffs in my photo library on disk, utilizing .ppignore to ignore them in photoprism. I've already created the jpgs alongside the tiffs in my photo album. Folders look something like `scan1.tif` with an accompanying `scan1.tif.jpg`, etc. If I run the index again, the new .tif.jpgs will be indexed in, creating duplicates of the tiffs that did make it into photoprism. To remedy that I'd like to remove the original .tifs. I suppose I'll have to start the library from scratch again. I was hoping to remove the converted tifs and their .yml files from the sidecar folders, but I understand they'd still remain in the database.
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

That'd be the easiest way.

@lastzero commented on GitHub (May 20, 2021): That'd be the easiest way.
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

What would the difficult way(s) entail, if you don't mind me asking. My library took a handful of days to fully index in, and it crashed twice, causing me to start again. At this point if I can get them out manually in a day or two, it's a win.

I'm assuming there's a way to delete photos from photoprism, and it would also delete from mariadb?

@ymgenesis commented on GitHub (May 20, 2021): What would the difficult way(s) entail, if you don't mind me asking. My library took a handful of days to fully index in, and it crashed twice, causing me to start again. At this point if I can get them out manually in a day or two, it's a win. I'm assuming there's a way to delete photos from photoprism, and it would also delete from mariadb?
Author
Owner

@lastzero commented on GitHub (May 20, 2021):

Well, you could book personal support as this isn't explained in one sentence. Are you a sponsor already?

@lastzero commented on GitHub (May 20, 2021): Well, you could book personal support as this isn't explained in one sentence. Are you a sponsor already?
Author
Owner

@ymgenesis commented on GitHub (May 20, 2021):

I'm not, was just assuming I'd get some advice here (which I have been getting from you), but I totally understand. You've talked with me for a while and I appreciate it! I'll figure it out haha. Thanks again.

@ymgenesis commented on GitHub (May 20, 2021): I'm not, was just assuming I'd get some advice here (which I have been getting from you), but I totally understand. You've talked with me for a while and I appreciate it! I'll figure it out haha. Thanks again.
Author
Owner

@lastzero commented on GitHub (May 22, 2021):

I'll close this as we're probably not able to support LZW compression in TIFFs anytime soon. It's best for now to convert them to PNG or JPEG using external tools.

@lastzero commented on GitHub (May 22, 2021): I'll close this as we're probably not able to support LZW compression in TIFFs anytime soon. It's best for now to convert them to PNG or JPEG using external tools.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#955
No description provided.