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

Non-animated GIF handling less than ideal #2

Closed
fire-eggs opened this issue May 18, 2020 · 2 comments
Closed

Non-animated GIF handling less than ideal #2

fire-eggs opened this issue May 18, 2020 · 2 comments

Comments

@fire-eggs
Copy link

Still finding this code to be extremely useful.

I've used the patch which changes fl_images_core.cxx, in fl_check_images, so that GIF files are loaded as Fl_Anim_GIF_Image instances.

But this leads to the following convolution when it comes time to draw, in order to handle non-animated GIFs:

		if (animgif_->is_animated())
		{
			animgif_->draw(xoff, yoff, xsize, ysize);
		}
		else
		{
			animgif_->Fl_Pixmap::draw(xoff, yoff, xsize, ysize);
		}

It "works" but requires "knowing" that Fl_Anim_GIF_Image is derived from Fl_Pixmap!

I'd prefer that animgif_->draw() would work for both animated and still GIFs. I'm not smart enough yet to quite understand the implications of this comment in the Fl_Anim_GIF_Image code:

    // Note: should the base class be called here?
    //       If it is, then the copy() method must also
    //       copy the base image!
//    Inherited::draw(x_, y_, w_, h_, cx_, cy_);

Advice, fixes appreciated.

@wcout
Copy link
Owner

wcout commented Jul 14, 2020

Hm, its a long time since I was active in this project...
Could you please give me a complete example code, so that I can see clearer, what your issue is?

@fire-eggs
Copy link
Author

Trying to create a sample program, I'm reminded about how much I've learned over the last few months.

This particular section of code is, in fact, dealing with the rare case that Fl_Anim_GIF_Image has failed to load a valid GIF file, in which case I've used Fl_GIF_Image as a fallback. The bug here is that Fl_GIF_Image fails to draw correctly. Not your bug!

Closing this issue and submitting an issue for the animated GIF file that Fl_Anim_GIF_Image fails to load.

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

2 participants