Error

Call to undefined function imagecreatefrompng()

/var/www/html/protected/models/Thumbnail.php(131)

119             trigger_error('Unable to open file "' . $filename . '"', E_USER_NOTICE);
120             return false;
121         }
122 
123         // determine image format
124         list( , , $type) = getimagesize($filename);
125 
126         switch ($type) {
127         case IMAGETYPE_JPEG:
128             return imagecreatefromjpeg($filename);
129             break;
130         case IMAGETYPE_PNG:
131             return imagecreatefrompng($filename);
132             break;
133         case IMAGETYPE_GIF:
134             return imagecreatefromgif($filename);
135             break;
136         }
137         trigger_error('Unsupport image type', E_USER_NOTICE);
138         return false;
139     }
140 
141     // }}}
142     // {{{
143 

Stack Trace

#0
+
 /var/www/html/protected/models/Thumbnail.php(96): Thumbnail::imageCreateFromFile("/var/www/html/uploads/1/images/kerjasama/oberlin1.png")
091      * @see    Thumbnail::imageCreateFromFile(), Thumbnail::imageCreateFromString()
092      */
093     private static function imageCreate($input)
094     {
095         if ( is_file($input) ) {
096             return Thumbnail::imageCreateFromFile($input);
097         } else if ( is_string($input) ) {
098             return Thumbnail::imageCreateFromString($input);
099         } else {
100             return $input;
101         }
#1
+
 /var/www/html/protected/models/Thumbnail.php(259): Thumbnail::imageCreate("/var/www/html/uploads/1/images/kerjasama/oberlin1.png")
254      * @see    Thumbnail::output()
255      */
256     private static function render($input, $options=array())
257     {
258         // Create the source image
259         $sourceImage = Thumbnail::imageCreate($input);
260         if ( ! is_resource($sourceImage) ) {
261             trigger_error('Invalid image resource', E_USER_NOTICE);
262             return false;
263         }
264         $sourceWidth  = imagesx($sourceImage);
#2
+
 /var/www/html/protected/models/Thumbnail.php(194): Thumbnail::render("/var/www/html/uploads/1/images/kerjasama/oberlin1.png", array("type" => 2, "width" => 750, "height" => 350, "method" => 1))
189      * @access public
190      */
191     public static function output($input, $output=null, $options=array())
192     {
193         // Load source file and render image
194         $renderImage = Thumbnail::render($input, $options);
195         if ( ! $renderImage ) {
196             trigger_error('Error rendering image', E_USER_NOTICE);
197             return false;
198         }
199 
2017-07-19 23:27:55 nginx/1.10.3 Yii Framework/1.1.17