ActionsDev
5 replies to this thread. Most Recent
thatkeith
7 Jul 2008, 9:27 am
WebYep image processing?
One for Max, although this is something that could benefit from other input perhaps…
I’ve just had a reply from the WebYep tech support people regarding a problem I was having with images being reprocessed and losing transparency. Here’s what I wrote to them, followed by their reply:
Me:
Hi - I’m trying to use images with transparency in a WebYep-driven page, with the WebYep Image element. It all works fine, except for the fact that the transparent area of the image is changed to a solid black!
This happens with GIF and PNG-24 images. I’ve replaced the image that WebYep stores with my original GIF and that shows up fine. All I need is for WebYep to leave transparency intact…
WebYep support:
When resizing uploaded images WebYep uses the PHP GD library and during that process the transparency gets lost.
If you do not set the WebYep Image Element’s dimensions (width and height) and do not activate the thumbnail feature, WebYep will use the uploaded image unprocessed and will leave the transparency intact.
Is it possible to do this in Freeway with the WebYep actions? My guess is not without getting the action to strip the dimensions from the graphic element as Freeway generates the code - is this right?
Currently, I have to (1) upload an image, (2) open the item from the refreshed web page in a new window to find out the name, (3) log into the server using Transmit, upload the original graphic (the one with transparency), (4) rename the WebYep-generated graphic, then (5) rename my uploaded item to take the place of the WebYep-generated image.
Doable, but definitely a PITA. :-)
k
max
7 Jul 2008, 11:09 amHi Keith
I had the same problem and its the PHP GD on the server (Part of PHP5) that drops the transparency and seeing its this that does all the compression of the file then I cant see how to get around it once the client needs to change an image with a completely different sized one.
In the end I turned that function off to auto in the action window and uploaded an image that was the correct size and already compressed. Then it worked fine because the GD extension istn’t used.
though if anybody else has a work around for this GD problem then I would be all ears.. :o)
max
it’s better to be lucky than clever.. :o)
thatkeith
7 Jul 2008, 11:20 amSometime around 7/7/08 (at 07:09 -0400) max said:
In the end I turned that function off to auto in the action window and uploaded an image that was the correct size and already compressed. Then it worked fine because the GD extension istn’t used.
Excellent and thanks! That did the trick. I’m afraid I didn’t understand the significance of the auto option there. Perhaps something like “(no server resizing)” could be added to the description for that part of the action UI? Or maybe I should just wake up a bit more, eh? :-)
k
max
7 Jul 2008, 11:47 amKeith I have gone through half a dozen changes on that and none are are right.. :o) so yep I think some more thought needs to go in to that one
on another note I have just tried your JPEG hack and I have something even more interesting… try this:
- create a png with a transparent background (I did try PNGf as an extension but I get an error)
- Now create a webyep image and make the image size fixed width and fixed height and publish normally you would have the same problem that if you upload a png with transparency then the GD extension would dump the transparency Channel.
- Now change the extension to JPEG.
- Even though its a png webyep see’s it as a JPEG and uploads it with its transparency channel This doesn’t actually re-compress the file but it does scale it to the correct size visually bloody good way around the GD lack of transparency support
it’s better to be lucky than clever.. :o)
thatkeith
7 Jul 2008, 12:04 pmSometime around 7/7/08 (at 07:47 -0400) max said:
bloody good way around the GD lack of transparency support
Weird and cool! But doesn’t this mean that PNG graphics are billed as JPEG in the code? And doesn’t this trip up the browsers? Especially the brain-dead IE?
k
max
7 Jul 2008, 12:20 pmHi Keith I haven’t tested it in IE though it works in safari and firefox I suppose I better test it on ie as well.. I can almost guarantee it wont work on that.. :o) max
it’s better to be lucky than clever.. :o)