Re: [GD-DEVEL] Problem with transparency

[email protected] ("Pierre Joye") Sat, 27 Sep 2008 00:58:39 +0200
Newsgroups php.gd.devel
Message-ID <[email protected]>
On Fri, Sep 26, 2008 at 8:20 PM, Brian Peschel <[email protected]> wrote:

> Okay, I poked around a bit more.  It appears my JPG image did not have
> transparency set correctly, hence it not working.

JPEG does not support any kind of transparency or background color.

> And it looks like I can
> get it working with the PNG file also.  From what I can find on the web,
> setting a color in the XPM to 'None' will cause transparency (which does
> work in X using a XpmCreatePixmapFromData(), XSetClipMask(),
> XSetClipOrigin(), and XCopyArea() combination).  In other words the line:
> "0 c None"
> means transparent.
>
> So, I took the tiling example at http://www.libgd.org/CopyResize and tweaked
> it a bit to match my usage (hopefully my attachments come through), see
> plotTest3.C.  I ran this with the four sample images (small.*).
> plotTest3 small.gif ; mv tiled.jpg tiled.gif.jpg
> small.gif Width 8 height 8 transparent 1
>
> plotTest3 small.jpg ; mv tiled.jpg tiled.jpg.jpg
> small.jpg Width 8 height 8 transparent -1
>
> plotTest3 small.png ; mv tiled.jpg tiled.png.jpg
> small.png Width 8 height 8 transparent -1
>
> plotTest3 small.xpm ; mv tiled.jpg tiled.xpm.jpg
> small.xpm Width 8 height 8 transparent -1
>
> The gdImageGetTransparent() result only shows a value for the GIF, not for
> the other 3.  However, the PNG did work (tiled.*.jpg).
>
> So, I have it working for GIF and PNG.  It isn't working for JPG (but I am
> fairly confident it it the source file).  It doesn't work with XPM.  Do I
> assume that it not working for XPM is a GD issue based on Pierre's comments
> above?

It could be a bug in XPM, I will take a look at it as soon as
possible. Can you open a bug in http://bugs.libgd.org please?

-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org