Skip to content
Snippets Groups Projects

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

#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

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Roman Paska added 1 commit

    added 1 commit

    • 47510761 - Move cspell ignore out of the general dictionary to the specific file

    Compare with previous version

  • quietone
  • quietone
  • quietone
  • Roman Paska added 1 commit

    added 1 commit

    • 5f5856b6 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Roman Paska added 1 commit

    added 1 commit

    Compare with previous version

  • Roman Paska added 108 commits

    added 108 commits

    Compare with previous version

  • Roman Paska added 207 commits

    added 207 commits

    Compare with previous version

  • Roman Paska added 82 commits

    added 82 commits

    Compare with previous version

  • Vladimir Roudakov added 776 commits

    added 776 commits

    Compare with previous version

  • Vladimir Roudakov added 50 commits

    added 50 commits

    Compare with previous version

  • Vladimir Roudakov added 211 commits

    added 211 commits

    Compare with previous version

  • 191 191
    192 192 // Invalidate the image object and return if the load fails.
    193 193 try {
    194 $image = $function($this->getSource());
    194 // Suppress warnings from a library action. Some functions can trigger
    195 // warnings that are not actionable like loading a PNG content with
    196 // certain color profiles. Actual issues with image processing will
    197 // trigger exceptions that are logged later on.
    198 $image = @$function($this->getSource());
    • Comment on lines +194 to +198

      This would swallow the warnings for good. Would it make sense to have a set_error_handler dance here, and log the warnings in the dblog? Bonus if such behavior could be controlled by a config flag editable in the toolkit config form.

    • We've discussed this quite a bit leading to the comment above the line. I understand why, @ is almost never the correct answer, so it flags everyone's code smell sensors.

      The error handler approach is a bit different, though I don't based on how GD triggers these that we'll have good data to log other then.

      Regardless, I'm of the opinion these aren't actionable, triggered by automated processes with limited impact, so we are not loosing anything by suppressing them. I don't know of any issues asking for this sort of information and if they did exist that would be a better place to discuss the solution.

    • Please register or sign in to reply
  • Ryan Hartman added 1 commit

    added 1 commit

    Compare with previous version

  • Vladimir Roudakov added 267 commits

    added 267 commits

    Compare with previous version

  • added 19 commits

    Compare with previous version

  • Roman Paska added 127 commits

    added 127 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading