- ๐บ๐ธUnited States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request โ as a guide.
Could you please provide steps/configuration taken to recreate this.
This will need a test case showing the issue.Thanks
- ๐บ๐ธUnited States jenlampton
I was able to recreate this by uploading a .webp image into an image/media reference field, and then rendering it using an image style.
- Status changed to Needs review
about 1 year ago 2:35pm 3 March 2023 - ๐ท๐บRussia Niklan Russia, Perm
I was able to extract the broken color profile from the image and apply it to another one and trigger that error in tests. The broken color profile called sRGB IEC61966-2.1. I'm attaching it as well, so you can test it by yourself on any image (by injecting it using CLI tools or image editors like GIMP, Krita, etc).
I'm also switch versions to 10.1.x, because patch from #8 wonโt apply on 10.0.x branch. And I focus initially on future branch, if it's needed it can be backported later on.
- ๐ท๐บRussia Niklan Russia, Perm
Updated issue summary with steps to reproduce this problem.
- ๐ท๐บRussia Niklan Russia, Perm
Sorry for noise, patch in #20 contains .icc profile by accident. This one is clean patches.
- ๐ท๐บRussia Niklan Russia, Perm
Gosh ๐คฏ
Anyway, since I need to create patches again, I generated a test image using
convert
instead of GIMP. It is smaller, because there is no GIMP metadata in it.๐ค
The last submitted patch, 22: drupal-3261924-22-test-only.patch, failed testing. View results โ
- ๐ท๐บRussia Chi
Personally, I would not create tests for suppression operators. Such tests are too tricky.
Also, I think it needs a comment explaining what kind of errors could happen without the suppression. - ๐ท๐บRussia Niklan Russia, Perm
Added comment for suppression call.
Disabled tests, because the only difference from #22 is comment.
- ๐ฉ๐ฐDenmark mudassar774
Re-rolled patch #3 to make it work with 9.5.5
- Status changed to RTBC
about 1 year ago 9:36pm 20 March 2023 - ๐ฆ๐บAustralia jannakha Brisbane!
#26 works! no more warning on d 9.5.5/php 8.1.1
thank you! - Status changed to Needs work
about 1 year ago 8:36am 21 March 2023 - ๐ณ๐ฟNew Zealand quietone New Zealand
The issue title is used as the commit message and it should state what this issue resolves instead of being a long error message.
Do we really want to suppress all warnings?
- Status changed to Needs review
10 months ago 4:20pm 12 July 2023 - last update
10 months ago 2,159 pass - ๐บ๐ธUnited States neclimdul Houston, TX
Better title.
Do we really want to suppress all warnings?
I had the same question, but I'm not sure what options we're really given. I suspect this is probably OK though because real problems will throw and exception which gets caught and logged. At least in the 10.x versions of this patch.
That said, the block we're adjusting is generalized for all image formats but the comment clearly only addresses the impact on PNGs. Very bikesheddy but maybe we should probably adjust the documentation to match the scope of the code not the scope of this issue. Something like this?
// Suppress warnings from image creation because there is a possibility // that source images contain data that would trigger non-fatal warnings // we can't handle. For example, a PNG saved with 'sRGB IEC61966-2.1' // color profile has 'iCCP' chunk data which is not recognized on most // systems and will cause libpng to trigger warnings but otherwise do not // affect image processing.
- Status changed to Needs work
10 months ago 9:13pm 17 July 2023 - ๐บ๐ธUnited States smustgrave
Looking at #25 and should the test go into ToolkitGdTest?
Also reading the last comment 31 think expanding to match makes sense. Least I can't think of a reason not to.
- ๐ง๐ชBelgium DieterHolvoet Brussels
Rerolled the last patch against 11.x.
53:57 53:13 Running- last update
9 months ago Patch Failed to Apply - ๐บ๐ธUnited States ricksta
I confirm the patch in 34 ๐ Avoid warning from imagecreatefrompng when loading png with obscure iCCP profiles Needs work works for Drupal 10.
- last update
7 months ago 29,672 pass - Status changed to RTBC
7 months ago 11:16pm 20 October 2023 - ๐บ๐ธUnited States mark_fullmer Tucson
Based on the comment from #35, I'm changing the status to RTBC.
- Status changed to Needs review
6 months ago 7:02pm 10 November 2023 - ๐บ๐ธUnited States neclimdul Houston, TX
Based on the rest of the comments and the lack of tests don't think this is actually ready. There aren't even tests on the last couple patches.
re: #32 what the heck is that test. Its not in the system module, its in the wrong location based on the namespace of the class, the file name doesn't align with the tested class? Something weird going on there but it does look like that's where existing tests are.
- last update
6 months ago Custom Commands Failed - Status changed to Needs work
6 months ago 8:18pm 10 November 2023 The Needs Review Queue Bot โ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- last update
6 months ago 29,686 pass - last update
6 months ago 29,686 pass - First commit to issue fork.
- Merge request !5800#3261924 Avoid warning from imagecreatefrompng when loading png with obscure iCCP profiles โ (Open) created by elaman
- Merge request !5801#3261924 Avoid warning from imagecreatefrompng when loading png with obscure iCCP profiles โ (Open) created by elaman
- ๐บ๐ฆUkraine Taran2L Lviv
Taran2L โ changed the visibility of the branch 3261924-avoid-warning-from to hidden.
- ๐บ๐ฆUkraine Taran2L Lviv
Taran2L โ changed the visibility of the branch png-11.x to hidden.
- Status changed to Needs review
5 months ago 2:04pm 18 December 2023 - Status changed to Needs work
5 months ago 2:47pm 20 December 2023 - ๐บ๐ธUnited States smustgrave
1 small feedback item.
Hiding patches for clarity.
- ๐บ๐ฆUkraine Taran2L Lviv
@smustgrave I disagree, the dictionary already has all the wierd words ...
- Status changed to Needs review
5 months ago 8:44am 21 December 2023 - Status changed to RTBC
5 months ago 2:30pm 21 December 2023 - ๐บ๐ธUnited States smustgrave
There was 1 error: 1) Drupal\KernelTests\Core\Image\ToolkitGdTest::testIncorrectIccpSrgbProfile with data set "PNG with iCCP profile" ('core/tests/fixtures/files/ima...le.png') PHPUnit\Framework\Exception: PHP Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile in /builds/issue/drupal-3261924/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php on line 271 Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile in /builds/issue/drupal-3261924/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php on line 271 /builds/issue/drupal-3261924/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/issue/drupal-3261924/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/issue/drupal-3261924/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651 /builds/issue/drupal-3261924/vendor/phpunit/phpunit/src/TextUI/Command.php:144 /builds/issue/drupal-3261924/vendor/phpunit/phpunit/src/TextUI/Command.php:97 ERRORS! Tests: 97, Assertions: 1197, Errors: 1.
Verified test coverage using test-only feature.
All feedback has been addressed.
@Taran2L as far as threads, as the opener of the thread I use to be able to close myself but that no longer seems to be the case. Think only the person who opened the MR can resolve threads now.
- ๐ณ๐ฟNew Zealand quietone New Zealand
I'm triaging RTBC issues โ . I read the IS, the comments and the MR. Thanks for the issue summary. As someone who doesn't work with images it was very clear and easy to understand the problem. I didn't find any unanswered questions.
I read the MR (not a code review) and there is minor work to do on the comments.
- Status changed to Needs work
5 months ago 7:01am 31 December 2023 - ๐ณ๐ฟNew Zealand quietone New Zealand
Oh sorry, @neclimdul, thank you for answering my question in #31.
- ๐ณ๐ฑNetherlands Wilfred Waltman
Rerolled patch from #34 for Drupal 10.2
- last update
5 months ago 25,813 pass, 1,797 fail 12:05 10:05 Running- last update
5 months ago 25,783 pass, 1,835 fail - last update
5 months ago 25,761 pass, 1,823 fail - ๐บ๐ฆUkraine Taran2L Lviv
Taran2L โ changed the visibility of the branch 10.2.x to hidden.
- Status changed to Needs review
4 months ago 10:53am 8 January 2024 - ๐บ๐ฆUkraine Taran2L Lviv
Feedback has been addressed
Also, attaching a static patch from the latest changes in the MR (for composer patching purposes)
- Status changed to Needs work
4 months ago 2:44pm 8 January 2024 - Status changed to Needs review
4 months ago 4:42pm 8 January 2024 - Status changed to RTBC
4 months ago 2:29pm 10 January 2024 - ๐ฆ๐บAustralia Nigel Cunningham Geelong
Attaching static version of MR for composer patch.
- Status changed to Needs work
3 months ago 6:25pm 3 February 2024 - ๐ฌ๐งUnited Kingdom longwave UK
The test doesn't work for me locally. With or without the change to GDToolkit I get:
Testing Drupal\KernelTests\Core\Image\ToolkitGdTest ..E 3 / 3 (100%) Time: 00:03.934, Memory: 4.00 MB There was 1 error: 1) Drupal\KernelTests\Core\Image\ToolkitGdTest::testIncorrectIccpSrgbProfile with data set "PNG with iCCP profile" ('core/tests/fixtures/files/ima...le.png') PHPUnit\Framework\Exception: libpng warning: iCCP: known incorrect sRGB profile
- ๐บ๐ฆUkraine Taran2L Lviv
@longwave this is very weird - it does not work on my local as well ... but it seems it does work on CI, weird
I think the value of the test is that error is being suppressed.
- ๐ท๐บRussia Niklan Russia, Perm
Hello again. I see some folks not very happy with silencing all the errors from that call. I understand that as well, it can be helpful sometimes. Without it, I won't be found this issue as well. Maybe we wrap this call
$image = @$function($this->getSource());
by a condition?We have already configuration `system.logging` with `error_level` setting. Maybe we will do it like:
if ($error_level === 'verbose') { $image = $function($this->getSource()); } else { $image = @$function($this->getSource()); }
This allows a developer to find out that there is a problem, but it won't be logged and showed on production instances. It might be looking ugly, but it solves most of the concerns here. Currently, as I remember correctly (I've already fixed that images), this will be logged on production on every over page with a broken image when it's processed for the first time (if no style yet created). In some cases, it can create a lot of useless noise in the logging system.
- ๐บ๐ธUnited States generalredneck
It IS possible to handle warnings, and therefore forego suppressing them all, but it would require setting up an error handler to do it. That said, if we are worried about particular image profiles, is there a way to whitelist some and check to see if the image is what we want? Is that too process intensive?
Trying to throw some fresh ideas at this that I didn't see in the comments. I do like Niklan's thoughts though.
- ๐บ๐ธUnited States neclimdul Houston, TX
I think the concerns might be a bit overstated. Actual problems will trigger real exceptions that get logged. This just avoids warnings that shouldn't be triggered. If I remember correctly they're warnings triggered by the underlying libraries so they don't actually follow PHP's documentation for the method.
- First commit to issue fork.
- ๐ฆ๐บAustralia VladimirAus Brisbane, Australia
Resolved MR conflict and added patches for D10 and D11.
- ๐บ๐ธUnited States rraney
Just curious about Patch 65. What's all the garbage text at the end of the file?
- ๐บ๐ธUnited States generalredneck
That's a new file... png based on the diff.
diff --git a/core/tests/fixtures/files/image-test-iccp-profile.png b/core/tests/fixtures/files/image-test-iccp-profile.png new file mode 100644 index 0000000000000000000000000000000000000000..29cb8945f8e4c1ae40de24bf888715e4d870a164 --- /dev/null +++ b/core/tests/fixtures/files/image-test-iccp-profile.png @@ -0,0 +1,24 @@ +โฐPNG
- ๐ฆ๐บAustralia VladimirAus Brisbane, Australia
Trying to bring all changed into new branch as pull from 11.x returns too many merge conflict. ๐คทโโ๏ธ
Also, changing branch to 11.0.x - ๐ฆ๐บAustralia VladimirAus Brisbane, Australia
VladimirAus โ changed the visibility of the branch 3261924-avoid-warning-from-d11.0 to hidden.