Skip to content
Snippets Groups Projects

#3261924 Avoid warning from imagecreatefrompng when loading png with obscure iCCP profiles

Closed #3261924 Avoid warning from imagecreatefrompng when loading png with obscure iCCP profiles
Closed Elaman Imashov requested to merge issue/drupal-3261924:11.x into 11.x
3 files
+ 75
2
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -191,7 +191,11 @@ protected function load() {
// Invalidate the image object and return if the load fails.
try {
$image = $function($this->getSource());
// Suppress warnings from a library action. Some functions can trigger
// warnings that are not actionable like loading a PNG content with
// certain color profiles. Actual issues with image processing will
// trigger exceptions that are logged later on.
$image = @$function($this->getSource());
}
catch (\Throwable $t) {
$this->logger->error("The image toolkit '@toolkit' failed loading image '@image'. Reported error: @class - @message", [
Loading