Developer forum

Forum » Development » GetImage.aspx

Reply

 

When using /Admin/Public/GetImage.aspx to resize a PNG image. How do I preserve the transparency of the image?

Replies

 
Reply
thl@dk.columbusit.com wrote:

 

When using /Admin/Public/GetImage.aspx to resize a PNG image. How do I preserve the transparency of the image?


 

This is not a supported feature. The same applies to GIF images.

 

 - Lasse

 
Reply

It's just been confirmed that it will be in the next release:)

 
Reply
Hi Sorenson,

Was this feature included? I am running the latest relaese and after using the getimage.aspx the file is blank. Check it out:

http://www.mydeltaq.com/admin/public/getimage.aspx?Image=/Files/Billeder/AdegaMayor/produtos/oito-2-garrafas.png&Format=png&Width=140

nuno
 
Nicolai Høeg Pedersen
Reply

Well yes and no.

If your original png file contains an alpha channel that describes how the transparancy should look like - then yes, it should work.

Otherwise no - its not possible.

http://www.google.dk/#hl=da&source=hp&q=png+transparency+alpha&meta=&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=a9ac24608f20d0b1
 

 
Reply
To what extend is this supported? This doesn't seem to work:

http://dev.nl.sapph.mediaweb.nl/admin/public/getimage.aspx?Image=/files/billeder/productimages/1014-117-10-2-white.png&Width=182&Height=800

While this one does:

http://dev.nl.sapph.mediaweb.nl/getimage.aspx?Image=/files/billeder/productimages/1014-117-10-2-white.png&Width=182&Height=800

The second example is a custom GetImage with code based on this article: http://getlara.com/north-america/canada/alberta/edmonton/post/2008/10/13/png-jpg-gif-image-resize-with-net-with-transparency

So, it seems that the image supports transparency, but DW doesn't maintain it?

Imar
 
Reply

Hi Imar,
 
Nice girl you have there :)
 
I guess you need the following settings to preserve transparency...
 
Format (required - defaults to JPG without transparency)
- PNG (always choose this - also when source is GIF)
 
Crop offset (required - only two options are available)
- Keep aspect ratio
- Fit image
 
Now, take a look at this beauty...
 
 
Is that the result you were looking for?
 
 
/Morten


 
 
Reply
Hi Morten,

Thanks a lot; that was indeed the result I was after. I played around with the Format (and tried PNG) but that didn't seem to help. The trick was to indeed to use Format=5 which preserves the transparency (and resizes, rather than crops which is exactly what we need).

Thank you and enjoy your weekend.

Imar

 

You must be logged in to post in the forum