Skip to content

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

Merged
mertalev merged 3 commits intomainfrom
fix/handle-invalid-icc
Oct 31, 2024
Merged

fix: warning instead of error for invalid icc when decoding jpeg#138
mertalev merged 3 commits intomainfrom
fix/handle-invalid-icc

Conversation

@mertalev
Copy link
Copy Markdown
Member

@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
Copy Markdown
Contributor

@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
Comment thread server/Dockerfile
*.deb \
/var/lib/apt/lists
/var/lib/apt/lists \
/usr/lib/$(arch)-linux-gnu/libjpeg.so* \
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member 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
@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