Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: expose TIFF compression in metadata #3667

Open
joesong168 opened this issue May 12, 2023 · 3 comments
Open

Enhancement: expose TIFF compression in metadata #3667

joesong168 opened this issue May 12, 2023 · 3 comments

Comments

@joesong168
Copy link

Question about an existing feature

metadata didn't return the image format for pyramid tif

What are you trying to achieve?

show the format of tile in metadata

@lovell
Copy link
Owner

lovell commented May 12, 2023

Please can you provide more details. Are you perhaps referring to the compression used within a TIFF image? A sample image and the expected output would be useful.

@joesong168
Copy link
Author

As tiff file has the option to contain tile in format like none, jpeg, deflate, it would be helpful to know the details before further actions, like whether to compress it again. Currently metadata function only return the format as 'tiff', I would suggest to add field called tile-format to indicate the format of tile.

Here is an example image file: https://viewers.etu.wiki/cfa461d04332d3648b44a18854a64687.tif

@lovell
Copy link
Owner

lovell commented May 12, 2023

Thanks, we'd need to expose this information via libvips first.

The underlying TIFF "compression" value is an integer - see https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tiff.h#L182-218

We'd probably want to map these to the relevant VipsForeignTiffCompression values - see https://www.libvips.org/API/current/VipsForeignSave.html#VipsForeignTiffCompression

The logic would probably live in/near rtiff_set_header() - see https://github.com/libvips/libvips/blob/master/libvips/foreign/tiff2vips.c#L1665

A PR to implement this in libvips would be welcome, if you're able.

@lovell lovell changed the title How to get the tile format for tif Enhancement: expose TIFF compression in metadata May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants