Coder Social home page Coder Social logo

gifcreator's People

Contributors

sybio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gifcreator's Issues

GIFs created with visual errors

I'm using a Wordpress plugin that uses this and GifFrameExtractor to resize animated GIFs. For the most part it works great but with certain GIFs, visual errors are introduced in the resized versions.

Here's an example:

Original:
Original

Resized:
Resized

I know you're not responsible for the Wordpress plugin, but I'm just trying to figure out what's going on. The errors seem to be consistent - ie, if I resize the image multiple times the errors in the resized versions look exactly the same.

I can provide more examples if it would help figure out the problem. It seems more likely to happen when there are large sections of a single color (in this case white).

Does this still work?

I can't get this to work at all, is it still functioning? Any real world examples?

Unable to create Gif (even though it's been working fine in many other similar occasions)

Warning: imagecreatefromstring(): gd-png: fatal libpng error: Read Error: truncated data in /Users/Flo/GitHub/whiteboard-comics/GifCreator.php on line 113

Warning: imagecreatefromstring(): gd-png error: setjmp returns error condition in /Users/Flo/GitHub/whiteboard-comics/GifCreator.php on line 113

Warning: imagecreatefromstring(): Passed data is not in 'PNG' format in /Users/Flo/GitHub/whiteboard-comics/GifCreator.php on line 113

Warning: imagecreatefromstring(): Couldn't create GD Image Stream out of Data in /Users/Flo/GitHub/whiteboard-comics/GifCreator.php on line 113

Fatal error: Uncaught exception 'Exception' with message 'GifCreator: Under development: 171 Source is not a GIF image.' in /Users/Flo/GitHub/whiteboard-comics/GifCreator.php:132
Stack trace:
#0 /Users/Flo/GitHub/whiteboard-comics/test.php(23): GifCreator\GifCreator->create(Array, Array, 0)
#1 {main}
thrown in /Users/Flo/GitHub/whiteboard-comics/GifCreator.php on line 132

Too much Memory Required

Dont work if pass paths? work only with imagecreatefrom()...

find better way

$GIF = new Imagick();
$GIF->setFormat("gif");

 for ($i = 0; $i < sizeof($gifFrames); ++$i) {
            $frame = new Imagick();
            $frame->readImage($gifFrames[$i]);
            $frame->setImageDelay(100);
            $GIF->addImage($frame);
        }

Imagick === No memory leak

PNG with transparent background changes to black

When I load 2 PNGs with transparent backgrounds, it changes to black.
I use small code change from (PNG to GIF converter - https://gist.github.com/gesior/6f5f7d15cb50f59a88fd) and now it works fine for PNGs. Before you add it, you must check, if other coversions still works fine.

Modified part of script:

        } elseif (is_string($frames[$i])) { // File path or URL or Binary source code

            if (file_exists($frames[$i]) || filter_var($frames[$i], FILTER_VALIDATE_URL)) { // File path

                $frames[$i] = file_get_contents($frames[$i]);                    
            }

            $resourceImg = imagecreatefromstring($frames[$i]);

            $background = array(255, 255, 255);
            $width = imagesx($resourceImg);
            $height = imagesy($resourceImg);
            $image = imagecreatetruecolor($width, $height);
            imagefill($image, 0, 0, $bgcolor = imagecolorallocate($image, $background[0], $background[1], $background[2]));
            imagecopyresampled($image, $resourceImg, 0, 0, 0, 0, $width, $height, $width, $height);
            imagecolortransparent($image, $bgcolor);

            ob_start();
            imagegif($image);
            $this->frameSources[] = ob_get_contents();
            ob_end_clean();

            imagedestroy($image);
        } else { // Fail

EDIT:
I did test it with these PNG as resources.
When I use 'imagepng', it save them with transparent background.
When I use 'imagegif', it save them with black background.
There must be something bad with PHP library that saves same image resource with/without transparency.

Problems with transparent gif

HI,

I found that after create any gif with transparence the new gif in transparent part has black layers moving.
@Sybio did you see this problem before? Could you solve this?
Thank you!

Regards

Compression artifacts on Windows

GifCreator is working great on Mac/Linux, however when using it on a Windows machine, the output has some heavy compression artifacts, more visible dithering, banding and color shifts between frames for example.

Mac output:
mac

Windows output:
windows

Any idea how this is caused?

Gif is too large

I have tested much times making gif from 11 jpg/jpeg images,the result is too large over 450kb.
Does GifCreator has some options or method to compress gif file?
Thanks a lot!

Create composer version

Hi

Can you create a tagged stable version number in git please so that I can use your library in composer without setting the minimum-stability flag to dev?

Thanks ;)

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.