Giter Club home page Giter Club logo

gif-endec's People

Contributors

kevinruscoe avatar stil 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gif-endec's Issues

Creating animation with transparency

Hello, when I try to recreate a gif file, which I splitted in frames before, does it somehow look weird.
This only happens with gifs which have transparency.
This is the example file:
Before:
test23

After:
animation

Corrupt file if local color tables

If you load up an animated gif, then substitute the stream of each frame with that of an altered gif file, then re-save, it switches to local color tables (as expected), but it comes out corrupt. Something is wrong about the file format implementation I think, but I don't have time to trace through it.
If I re-save with the same frame streams it works okay. If I hack the code to disable local color table saving it saves okay but with corrupt palette (as expected).

Disposal method 3 is not implemented

Some GIF's give this error when trying to decode. I have attached a broken GIF and a working GIF

WORKING - WORKING
BROKEN - BROKEN

Source of error: https://github.com/stil/gif-endec/blob/master/src/Renderer.php#L66-L73
Code Example

            $gifStream = new FileStream($uploadedFile);
            $gifDecoder = new Decoder($gifStream);
            $gifRenderer = new Renderer($gifDecoder);

            $gifRenderer->start(function(FrameRenderedEvent $event) use (&$frames) {
                $frames[] = $event->renderedFrame;
            });

The error from laravel

    "message": "Disposal method 3 is not implemented.",
    "exception": "RuntimeException",
    "file": "C:\\wamp64\\www\\minecraftcapes\\vendor\\stil\\gif-endec\\src\\Renderer.php",
    "line": 72,

Transparent animated Gifs

Hi!
I installed the GIFEndec because Sybio's Lib made some glitchy pixel salad out of my gif graphics.
When I used your test.gif, everything was fine, but with my gif file:
http://www.nokuku.com/objects/bluebird_l.gif
The code throw this exception:

Uncaught exception 'RuntimeException' with message 'Disposal method 2 is not implemented.'

Please could you help me? Thanks in advance!
Lioba

Decoding fails

I try to decode the image downloaded from http://icons.wxug.com/i/c/k/clear.gif

it fails. Error I get is "Fatal error: Uncaught Error: Call to a member function setOffset() on null in GIFEndec/Decoder.php:242".

It seems no $this->currentFrame has been created. If I create one "on the fly" in decode() it works.

    public function decode(callable $onFrameDecoded)
    ....
                    case 0x2C:
                        if (!$this->currentFrame) {
                           $this->currentFrame = new Frame();
			}   

Call to a member function setOffset() on null

Hello I am having issues with the Decoder giving me the error of 'Call to a member function setOffset() on null'

I am receiving a base64 string from the front end, converting that string to a gif image and then writing that image to a folder. Everything seems to work fine until I hit the Decoder. here is my code below.

        public function video(Request $request) {

                $date = Carbon::now()->format('m-d-Y');

                // split the string on commas
                // $data[ 0 ] == "data:image/png;base64"
                // $data[ 1 ] == <actual base64 string>
                $data = explode( ',', $request->image);
                $image = Image::make($data[1])->encode('gif');
                $fileName = uniqid() . '.' . 'gif';
                $location = 'uploads/' . $fileName;
                $image->save($location);
                    

                $gifStream = new FileStream($location);

                 //Create Decoder instance from MemoryStream
        
                $gifDecoder = new Decoder($gifStream);


                //Create Renderer instance
                 
                $gifRenderer = new Renderer($gifDecoder);


                $gifRenderer->start(function (FrameRenderedEvent $event) {
                    //Convert frame index to zero-padded strings (001, 002, 003)
                    $paddedIndex = str_pad($event->frameIndex, 3, '0', STR_PAD_LEFT);
                    // Write frame images to directory
                    imagepng($event->renderedFrame, "uploads/frame{$paddedIndex}.png");
                });
                return 'ok';
    }

how to get frame count?

i nedd frame count in render and decorder.
see in following code
$gifStream = new FileStream($target_file);
$gifDecoder = new Decoder($gifStream);
$gifRenderer = new Renderer($gifDecoder);
$gifRenderer->start(function (FrameRenderedEvent $event) {
imagepng($event->renderedFrame, DIR . "/../gif_render/frame{$event->frameIndex}.png");
});
and how to change png filepath and filename(here is gif_render/frame ....png).
then create png, how know png count?

How to use the library with CodeIgniter

I want to create a gif, but the use of the library with this framework has been extended to me, is there any experience?

I have added the file package in the code igniter library folder, creating the function intact in this way for example
$ this-> load-> library ('Color');
$ this-> load-> library ('Encoder');
$ this-> load-> library ('Frame');
$ this-> load-> library ('/ IO / FileStream');

But at the time of mail the function throws me

An Error Was Encountered

Non-existent class: Color

Binary-unsafe memory stream implementation

PHP can be configured how it reads files, regarding \r\n.

MemoryStream.php should always use fopen with 'b' included in the method strings to ensure this doesn't happen.

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.