Skip to content
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

Partial loading of GIF image #29

Open
YeeticusFinch opened this issue May 13, 2019 · 1 comment
Open

Partial loading of GIF image #29

YeeticusFinch opened this issue May 13, 2019 · 1 comment

Comments

@YeeticusFinch
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant