Skip to content

Random loss of ICC profiless due to PR #3623 #4321

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

Closed
DarthSim opened this issue Dec 17, 2024 · 3 comments
Closed

Random loss of ICC profiless due to PR #3623 #4321

DarthSim opened this issue Dec 17, 2024 · 3 comments
Labels

Comments

@DarthSim
Copy link
Contributor

Hey team 👋

I found a pretty nasty libvips behavior appeared because of #3623 (more specifically: 0d665ba). This PR adds stripping ICC profiles when converting from/to scRGB. While this seems correct at first glance, this also makes vips behave unpredictably.

For example, you import ICC with vips_icc_import and then convert the image to sRGB. Since the conversion from XYZ/LAB to sRGB goes through vips_sRGB2scRGB_build, it removes the ICC profile from the image. The same happens if you apply vips_sharpen and convert the image back to sRGB.

@DarthSim DarthSim added the bug label Dec 17, 2024
@jcupitt
Copy link
Member

jcupitt commented May 21, 2025

Hi @DarthSim, I think this is fixed in 8.17. For example:

$ vipsheader -a shark.jpg | grep icc
icc-profile-data: 3048 bytes of binary data
$ vips icc_import shark.jpg x.v 
$ vips colourspace x.v x2.v srgb
$ vipsheader -a x2.v | grep icc
icc-profile-data: 3048 bytes of binary data

Would you be able to test?

@DarthSim
Copy link
Contributor Author

It indeed is fixed 👍
I see that you got rid of ICC removal during scRGB->sRGB conversion in this commit: 1db77ac

@jcupitt
Copy link
Member

jcupitt commented May 21, 2025

Great! Thanks for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants