-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animated GIF bugged colors #36
Comments
so what exactly does your code look like?? On Thu, Feb 27, 2014 at 6:58 AM, Kekke88 notifications@github.com wrote:
|
please also attach the images as pieces so we can try to duplicate your error. thank you. |
[code] extract($gifPath); ``` $watermarkLayer = ImageWorkshop::initFromPath('wm.png'); $retouchedFrames = array(); //$it = 0; foreach ($frames as $frame) { $frameLayer = ImageWorkshop::initFromResourceVar($frame['image']); $frameLayer->resizeInPixel($frameLayer->width, $frameLayer->height, false); $frameLayer->addLayerOnTop($watermarkLayer, 20, 20, 'LB'); $image = $frameLayer->getResult(); // Creating all the GIF Images //imagejpeg($image, 'test' . $it . '.jpg', 95); $retouchedFrames[] = $frameLayer->getResult(); //$it++; } // Then we re-generate the GIF $gc = new GifCreator(); $gc->create($retouchedFrames, $gfe->getFrameDurations(), 0); // And now save it ! file_put_contents('newgif.gif', $gc->getGif()); } ``` ?>[/code] |
I've also tried using a color in the getResult as suggested but to no avail. |
I think you may need to may a group layer for the addLayerOnTop to work properly. also it looks like you may be working with a true color and non true color images (gif, png) you could try converting the png to a palette with imagetruecolortopalette() function. |
As I said in my first post, it doesn't matter if I add the watermark or not, it still gets that blue color. |
you could try saving each image after each step to find out when the blue's added. also the resize is pointless, your resizing it to it's current size. |
I have tried saving them after each step as I said in my first post, the blue gets added to the second image. I tried without resize function but the image just becomes a 24kb file that I can't view. |
try: extract($gifPath); // Then we re-generate the GIF $gc = new GifCreator(); $gc->create($frames, $gfe->getFrameDurations(), 0); // And now save it ! file_put_contents('newgif.gif', $gc->getGif()); } ?>to check that it is the image workshop and not the extractor / gif merge process. |
I get the following error from using your code: Notice: Undefined variable: mode in C:\xampp\htdocs\gifwm\GifCreator.php on line 120 Fatal error: Uncaught exception 'Exception' with message 'GifCreator: Under development: You have to give resource image variables, image URL or image binary sources in $frames array. ()' in C:\xampp\htdocs\gifwm\GifCreator.php:120 Stack trace: #0 C:\xampp\htdocs\gifwm\new.php(52): GifCreator->create(Array, Array, 0) #1 {main} thrown in C:\xampp\htdocs\gifwm\GifCreator.php on line 120 |
I have the same problem. Refreshing and ask for help |
Hi, I've just make some test about this issue. The bug is not located in the ImageWorkshop library. It is a GifFrameExtractor library bug, due to some transformation for extracting each GIF frame (in So I close this issue and open a issue in the appropriated repository. Thanks for your feedback. |
Hello, I've been trying to add an image upon a GIF image using your libraries.
However, it turns the gif image into some weird blue color.
I have tried to debug but I can't find what's wrong, I tried using getResult with a background color but it still didn't help.
I printed the frames as images and it seems that image #2 is the first image to get weird colors.
Here is the picture before:
http://i.imgur.com/M3bM7yP.gif
and after:
http://i.imgur.com/lyMu2P0.gif
All the images extracted:
http://imgur.com/2kFqUzw,TAxAjeC,YzM4ztE,alotpAS,CdUTa7a,IQQiylp,BjI14CD,IlrQZiC,mo2vrs1,QPEsR67,ohFZ4sN,xM9jzvC,GyA3Toa,Eepmqhv,O5vxpfc,IE1lKG9,EqP9foq,VAtE7oY,sVsteMd,NtQziAE,YVKMGfz,4GEgyBf,3cvPE7m,hgJtWCt,dbbQSNe,mrBjnRN,MgAbBqi,1i3yhLn,43GUKOu,hkmXP0n,ysajT72#1
Regards
The text was updated successfully, but these errors were encountered: