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 #71316: libpng warning from imagecreatefromstring #7615

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Oct 26, 2021

We backport the respective upstream fix[1] to our bundled libgd, and
add a regression test, too.

[1] libgd/libgd@636100b

We backport the respective upstream fix[1] to our bundled libgd, and
add a regression test, too.

[1] <libgd/libgd@636100b>
@cmb69 cmb69 added the Bug label Oct 26, 2021
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

Looks okay, though it would be nice to have a more targeted test image.

@cmb69
Copy link
Member Author

cmb69 commented Nov 2, 2021

I tried to come up with a smaller test image long ago, but failed, and that was basically the reason why I didn't fix that issue in libgd; now they fixed it without any test case.

@nikic
Copy link
Member

nikic commented Nov 3, 2021

Well, we could do the same then :)

@cmb69 cmb69 closed this in 1919c4b Nov 4, 2021
@cmb69
Copy link
Member Author

cmb69 commented Nov 4, 2021

Okay, I applied without the test.

@cmb69 cmb69 deleted the cmb/71316 branch November 4, 2021 10:24
@mmarquez
Copy link

mmarquez commented Jan 7, 2022

I've a site with PHP 8.0.14 and I've found an image that raise the same error https://imgur.com/a/XwVKwxr

@cmb69
Copy link
Member Author

cmb69 commented Jan 7, 2022

@mmarquez, your GD is likely built against system libgd.

@dzuelke
Copy link
Contributor

dzuelke commented Jan 27, 2022

@cmb69 issue is back here on 8.0.14, built against bundled libgd:

$ readelf -d .heroku/php/lib/php/extensions/no-debug-non-zts-20210902/gd.so | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpng16.so.16]
 0x0000000000000001 (NEEDED)             Shared library: [libwebp.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libjpeg.so.8]
 0x0000000000000001 (NEEDED)             Shared library: [libfreetype.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

Downgrading to 8.0.13 fixes it; no warnings.

@dzuelke
Copy link
Contributor

dzuelke commented Jan 27, 2022

Okay so I guess this is from 1919c4b; is the recommended way then really to prefix all load operations with @?

@dzuelke
Copy link
Contributor

dzuelke commented Jan 27, 2022

And/or should there be a setting similar to gd.jpeg_ignore_warning?

The problem is that there is no gd_last_error() or similar, so it's hard to programmatically capture these warnings.

@cmb69
Copy link
Member Author

cmb69 commented Jan 27, 2022

@dzuelke, yes, I think there should be something like gd.jpeg_ignore_warning. And some gd_last_error() might be a good idea as well, although I'm not really sure about that.

@brettwhiteman
Copy link
Contributor

I've submitted a PR to actually fix the problem in the bundled GD code
#8002

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

Successfully merging this pull request may close these issues.

5 participants