[wp-trac] [WordPress Trac] #13461: Preserve GIF transparency/alpha during thumbnail creation
WordPress Trac
noreply at wordpress.org
Wed Oct 24 01:00:47 UTC 2012
#13461: Preserve GIF transparency/alpha during thumbnail creation
-------------------------------------------------+--------------------
Reporter: javitxu123 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5
Component: Media | Version: 2.9.2
Severity: normal | Resolution:
Keywords: needs-testing 3.5-early needs-patch |
-------------------------------------------------+--------------------
Changes (by bpetty):
* cc: bpetty (added)
* keywords: has-patch needs-testing 3.5-early => needs-testing 3.5-early
needs-patch
Comment:
Just to clarify since this has changed in SVN trunk since the last update
here (and latest patch), I am using the latest SVN trunk with the new
WP_Image_Editor, and I have disabled the imagick editor (filtering
"wp_editors" - which might be renamed "wp_image_editors" soon - see
ticket:6821#comment:90) so it falls back on GD - which is what this patch
is intended for.
I can't get (an un-touched copy of) [attachment:xparent.gif] to show
transparency after being resized, cropped, flipped, or rotated using
[attachment:13461.4.patch]. It continues to use a white background just
like SVN trunk. This is while using PHP 5.3.10, libgd 2.0.36 (not bundled,
which is the default for Ubuntu 12.04).
However, I was able to take the same GIF image, make some minor
modifications in GIMP (see [attachment:xparent-gimp.gif] - the darker
levels are intentional), and get transparency to work using
[attachment:13461.4.patch], but it is very temperamental, and can result
in very negative results. See [attachment:xparent-resized.png].
I have refreshed the latest patch anyway for others wanting to re-test on
latest SVN trunk: [attachment:13461.5.patch]
For what it's worth, WordPress does currently use the same color used for
transparent values in GIF images - which is the appropriate decision when
transparency can not be preserved. This is why the GIF image attached here
uses white while some others use black. It's also possible that some rare
GIF images use a different color altogether (try using [attachment
:xparent-blue.gif]). If the image uses a black background where it
shouldn't, it's because the GIF image was not ideally created with this in
mind. If we can't find a way to perfectly handle GIF image transparency,
this behavior should remain. We shouldn't use any approach like comment:3
that arbitrarily chooses a color to use for transparency, or overrides the
color values saved in the GIF in transparent locations. I do still plan on
taking another shot at a better patch though still.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13461#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list