From 479da5aa868d791b4c680e1f10a89e8f075efc10 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Feb 2021 08:30:04 +0300 Subject: [PATCH] jimIcon: hide GD warning --- classes/rssutils.php | 4 ++++ lib/jimIcon.php | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/classes/rssutils.php b/classes/rssutils.php index 45cddb200..42819247b 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -595,9 +595,13 @@ class RSSUtils { Debug::log("checking favicon...", Debug::$LOG_VERBOSE); + user_error("before favicon", E_USER_WARNING); + self::check_feed_favicon($site_url, $feed); $favicon_modified_new = file_exists($favicon_file) ? filemtime($favicon_file) : -1; + user_error("after favicon", E_USER_WARNING); + if ($favicon_modified_new > $favicon_modified) $favicon_avg_color = ''; diff --git a/lib/jimIcon.php b/lib/jimIcon.php index d976c808b..cee1a7bad 100644 --- a/lib/jimIcon.php +++ b/lib/jimIcon.php @@ -104,7 +104,12 @@ class jimIcon { } // See if we can parse it (might be PNG format here) - $i = @imagecreatefromstring($data); + // (all this to hide one GD warning) + $er = error_reporting(); + error_reporting(0); + $i = imagecreatefromstring($data); + error_reporting($er); + if ($i) { imagesavealpha($i, true); return $i;