Giter Site home page Giter Site logo

jimicon's People

Contributors

gregthib avatar jimparis avatar jtojnar avatar

Watchers

 avatar  avatar

Forkers

jtojnar

jimicon's Issues

hiding imagecreatefromstring() warning

UPDATE: oops, looks like GD simply ignores any error_reporting control whatsoever, so just ignore the below. sorry for the noise.

sorry it's not a PR. as I was testing php8, I ran into jimIcon generating stubborn GD warnings at line 107, it seems that @ is already there but either GD or PHP ignores it. this ugly blob was the best I could do to hide it:

diff --git a/lib/jimIcon.php b/lib/jimIcon.php
index d976c808b..29ae8df1d 100644
--- a/lib/jimIcon.php
+++ b/lib/jimIcon.php
@@ -103,8 +103,12 @@ class jimIcon {
                         return false;
                 }

-                // See if we can parse it (might be PNG format here)
-                $i = @imagecreatefromstring($data);
+                                        // See if we can parse it (might be PNG format here)
+                                        $er = error_reporting();
+                                        error_reporting(0);
+                                        $i = imagecreatefromstring($data);
+                                        error_reporting($er);
                 if ($i) {
                         imagesavealpha($i, true);
                         return $i;

not sure if there's any better way, mentioning it here so this won't get reintroduced at some time later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.