PHP Classes
elePHPant
Icontem

Bug in class

Recommend this page to a friend!

      Animated PNG Creator  >  All threads  >  Bug in class  >  (Un) Subscribe thread alerts  
Subject:Bug in class
Summary:The image is blinking
Messages:3
Author:Timur
Date:2011-06-02 17:05:21
 

  1. Bug in class   Reply   Report abuse  
Timur - 2011-06-02 17:05:21
Hi, Dzsoni!

First of all thank you very much for such a wonderful class. Though I am facing one problem with it. The thing is that I am trying to make the class return me the generated animated PNG instead of writing it to a file. So, I just commented all the functions with files, created the $output variable and concatinated all the $out variables to $output at the locations where you use fwrite. At the end I just return the image. Then I set the required header in my script like:

Header ( 'Content-type:image/png');
ob_start();
echo $png->save();
$gen_im=ob_get_contents();
$file_size=ob_get_length();
ob_end_clean();

echo $gen_im;

The animation works but somehow empty frame appears and I do not know where it comes from. I checked all the frames I provide to the class - they are all fine when used separately. But if I add more than 1 frame it starts blinking again.

you can find the example here http://preloaders.net/blinking.png .
I modified your file as follows:
preloaders.net/class_sample.txt (lines 174, 175, 176, 194, 195, 248, 249 and 256)

Please help me. I really need this thing working.

  2. Re: Bug in class   Reply   Report abuse  
manik - 2015-10-06 12:54:08 - In reply to message 1 from Timur
I am new in php. I am faceing problem to create a animeted png from static png file with APNG_Creator.php.

The error is
1. "imagesx(): supplied argument is not a valid Image resource in APNG_Creator.php on line 142"

2. "imagesy(): supplied argument is not a valid Image resource in APNG_Creator.php on line 143"

Kindly upload full script to get animeted png file with APNG_Creator.php.

  3. Re: Bug in class   Reply   Report abuse  
manik - 2015-10-09 05:47:23 - In reply to message 2 from manik
Problem solved.