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

fix: warning instead of error for invalid icc when decoding jpeg #138

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

mertalev
Copy link
Contributor

@mertalev mertalev commented Oct 31, 2024

Description

If the ICC profile is corrupt, it can be ignored without preventing the image from being decoded. This PR adds a patch to make this change until this is handled upstream with this PR.

Also changes build cleanup to delete libjpeg-turbo files manually instead of using dpkg, as the latter results in apt complaining.

Testing

Tested with this sample image and confirmed that it was processed successfully with this change, but failed without it.

@mertalev mertalev force-pushed the fix/handle-invalid-icc branch from a83499d to c13a251 Compare October 31, 2024 00:32
Copy link
Member

@martabal martabal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we start to have multiple patches, can we store them in a patch folder?

@mertalev mertalev force-pushed the fix/handle-invalid-icc branch from 104c147 to 9b851f5 Compare October 31, 2024 00:54
rm -rf \
configure-apt.sh \
install-ffmpeg.sh \
*.deb \
/var/lib/apt/lists
/var/lib/apt/lists \
/usr/lib/$(arch)-linux-gnu/libjpeg.so* \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to remove libjpeg?
Sharp does not use by default the decoder from /usr/local/lib?

root@03fa65ee8b06:/# ldd /usr/local/bin/vips | grep jpeg
        libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x000014f26b39f000)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes the image smaller and avoids any ambiguity.

@mertalev mertalev merged commit 892001e into main Oct 31, 2024
3 checks passed
@mertalev mertalev deleted the fix/handle-invalid-icc branch October 31, 2024 03:43
@mertalev mertalev mentioned this pull request Nov 1, 2024
3 tasks
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

Successfully merging this pull request may close these issues.

3 participants