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

Allow GIFs missing both Global and Local Colormaps to still decode #494

Merged
merged 7 commits into from
Mar 3, 2021

Conversation

az6667
Copy link
Contributor

@az6667 az6667 commented Jan 29, 2019

Ensure that a GIF without any Global or Local color tables is still
decoded by libgd.

GIF89a spec indicates conforming image files need not have
Global or Local color tables at all.

Spec recommends creating custom color map in that situation, and
that at least Black+White as first two entries, to ensure B&W images
are decoded.

Some commonly used single-pixel GIFs found around the web are
undecoded by libgd otherwise. Test case has been included.

References:
https://www.w3.org/Graphics/GIF/spec-gif89a.txt
http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever

Ensure that a GIF without any Global or Local color tables is still
decoded by libgd.

GIF89a spec indicates conforming image files need not have
Global or Local color tables at all.

Spec recommends creating custom color map in that situation, and
that at least Black+White as first two entries, to ensure B&W images
are decoded.

Some commonly used single-pixel GIFs found around the web are
undecoded by libgd otherwise. Test case has been included.

References:
https://www.w3.org/Graphics/GIF/spec-gif89a.txt
http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
tests/gif/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! While we don't fully support the GIF spec anyway, I think allowing to read GIFs without color maps is a reasonable improvement,

Consistent use of LIST(APPEND over SET(
In some distros (Fedora/Centos), finding "freetype" would fail.
This asks pkg-config for some help. Recycled the pkg-config
example that was in "FindFontConfig.h"
src/gd_gif_in.c Outdated Show resolved Hide resolved
This reverts commit 8b569e7.
Fixes will be sent to the upstream project (cmake).
@vapier vapier merged commit fc38677 into libgd:master Mar 3, 2021
@vapier
Copy link
Member

vapier commented Mar 3, 2021

thanks!

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

Successfully merging this pull request may close these issues.

3 participants