extrapixel / gif-animation

GifAnimation is a Processing library to play and export GIF animations
GNU General Public License v3.0
171 stars 38 forks source link

Partial loading of GIF image #29

Open YeeticusFinch opened 5 years ago

YeeticusFinch commented 5 years ago

So the image doesn't seem to be fully loading. This problem only happens for certain GIF images, such as this one: https://media.tenor.com/images/532d794fb57c2b1bfbcedef396e93ce1/tenor.gif Yet this code works for most other GIF images. What might be different about this image? I have included a screenshot of the program running along with the code responsible for the content in that screenshot.

Screen Shot 2019-05-13 at 4 47 39 PM
import ui.*;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import processing.awt.PSurfaceAWT;
import processing.core.PApplet;

public class Test {

    public static void main(String args[]) {
        GIFTester drawing = new GIFTester();
        PApplet.runSketch(new String[] { "" }, drawing);
        PSurfaceAWT surf = (PSurfaceAWT) drawing.getSurface();
        PSurfaceAWT.SmoothCanvas canvas = (PSurfaceAWT.SmoothCanvas) surf.getNative();
        JFrame window2 = (JFrame) canvas.getFrame();
        window2.setSize(400, 300);
        window2.setMinimumSize(new Dimension(100, 100));
        window2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        window2.setResizable(true);

        window2.setVisible(true);

        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        window2.setLocation(screenSize.width/2-window2.getSize().width/2, screenSize.height/2-window2.getSize().height/2-window2.getSize().height);

    }

}
package ui;
import java.util.concurrent.TimeUnit;

import gifAnimation.Gif;
import meme.Meme;
import processing.core.*;
import web.MindReader;

public class GIFTester extends PApplet {
    Gif myAnimation;
    public GIFTester() {
    }

    public void setup() {
        myAnimation = new Gif(this, "images/d30920c9d6a4013fd8a0b99decebfba4.gif");
        myAnimation.play();
    }

    public void draw() {
        image(myAnimation, 10, 10);
    }
}
YeeticusFinch commented 5 years ago

Looks like the GIF has too high of a resolution. I've tried that same GIF with a lower resolution and it works.