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

libpng compatibility issue with zTXt text containing non-latin characters #123

Closed
jcupitt opened this issue Aug 14, 2020 · 3 comments · Fixed by #124
Closed

libpng compatibility issue with zTXt text containing non-latin characters #123

jcupitt opened this issue Aug 14, 2020 · 3 comments · Fixed by #124
Labels
bug Something isn't working confirmed libpng compat libpng compatibility issue

Comments

@jcupitt
Copy link

jcupitt commented Aug 14, 2020

Hello @randy408, this image reads fine with libpng, but produces non-recoverable state with git master libspng.

some.png.zip

Original bug report:

libvips/libvips#1778

@randy408 randy408 added bug Something isn't working libpng compat libpng compatibility issue confirmed labels Aug 14, 2020
@randy408 randy408 changed the title image loads with libpng, but fails with libspng libpng compatibility issue with zTXt text containing non-latin characters Aug 14, 2020
@randy408
Copy link
Owner

That PNG has a zTXt chunk where the text field contains UTF-8 characters, it should be in a iTXt chunk instead, according to the standard:

Decompression of this datastream yields Latin-1 text that is identical to the text that would be stored in an equivalent tEXt chunk.

Looks like libpng does not check the text field at all.

@jcupitt
Copy link
Author

jcupitt commented Aug 14, 2020

Thanks!

@randy408
Copy link
Owner

randy408 commented Aug 14, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed libpng compat libpng compatibility issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants