[Solved] imagepng() expects parameter 1 to be resource [closed]

Read the manual! You have to first obtain an image resource, returned by one of the image creation functions, such as imagecreatefrompng(): $file = $PNG_WEB_DIR.basename($filename); $img = imagecreatefrompng($file); // … ob_start(“output_handler”); imagepng($img,NULL,9); $image_data = ob_get_contents(); ob_end_flush(); 4 solved imagepng() expects parameter 1 to be resource [closed]

[Solved] What really is a PNG? [closed]

Standard PNGs don’t support editing. Simplifying it a bit, they are just what you said they are: losslessly compressed bitmaps (vs JPGs, which employ lossy compression, or GIFs which are also bitmaps, but only support up to a 256 color palette). Fireworks PNGs contain a special header and extra data that allows them to retain … Read more