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

fails on file processed with vips, but works if png used as intermediary #254

Open
andrisi opened this issue Mar 22, 2023 · 5 comments
Open

Comments

@andrisi
Copy link

andrisi commented Mar 22, 2023

I have lots of TIFF files, which are not served correctly by IIPSRV if they are turned into multilayer ones with vips using the command line below. The tiles returned are invalid according to Chrome, Windows Picasa, etv.. If I save the file to PNG, and then to multilayer TIFF, they work fine. If you're interested I can provide the files.

vips tiffsave X2.raw X2.tiff --vips-progress --tile --pyramid --compression deflate --tile-width 256 --tile-height 256

On conversion to PNG with

vips pngsave A1.tiff X2.png --vips-progress

I get this below, but upon converting the PNG to TIFF, serving from IIPSRV works fine:

(vips:643988): VIPS-WARNING **: 21:47:15.724: profile 'icc': 0h: PCS illuminant is not D50
(vips:643988): VIPS-WARNING **: 21:47:15.724: bad ICC profile not saved
@ruven
Copy link
Owner

ruven commented Mar 22, 2023

It's probably an invalid ICC profile which causes Chrome to reject it. When you first save as PNG, the profile gets stripped, which is why converting from PNG to TIFF works. Anyway, please send me an example file and I'll take a closer look.

@andrisi
Copy link
Author

andrisi commented Mar 22, 2023

You mean you send the TIFF file's ICC profile with every tile? Sorry, I'm not that much into the details of TIFF format and to find out where/what fails, but thanks a lot for getting back to me.

@ruven
Copy link
Owner

ruven commented Mar 23, 2023

Thanks I've got the image.

ICC profiles are added by default to the tiles so that the browser knows how to correctly display the colors. There is an iipsrv environment parameter: EMBED_ICC, which you can set to 0 if you don't want any profiles added.

However, in your particular case, the profile is very large, so iipsrv strips it out anyway. And the image works fine for me after conversion using the vips command you posted earlier. Which version of iipsrv are you using exactly? 1.1 or the latest code from Github? If you are trying to view the tiles in PNG format, I just committed a fix to a potential bug, so maybe this will help. And can you post the lines from the iipsrv log file when an error occurs?

@andrisi
Copy link
Author

andrisi commented Mar 23, 2023

Thanks! I used the one from the Ubuntu 22 repository, will check.

@ruven
Copy link
Owner

ruven commented Mar 23, 2023

OK, it's iipsrv version 1.1 in the Ubuntu repository. There's in fact a bug in that version when you have very large ICC profiles. So, just set EMBED_ICC to 0 and it should work fine. This is now, in any case, fixed if you use the latest code.

@andrisi andrisi changed the title fails on file processed with vips, but works if png ised as intermediary fails on file processed with vips, but works if png used as intermediary Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants