How do I get Kartris to render transparent .png files properly???


https://forum.kartris.com/Topic2814.aspx
Print Topic | Close Window

By RBaker - Tue 11 Feb 2014
I am customizing the Kartris front end skin and I am having issues with how the item images are displaying. My item images are .png files with transparent backgrounds. I upload them through Admin and when I view them on the front end they have black backgrounds- no longer transparent. When I view the source I see Image.aspx?strFileName=p1_01.png, but when I right-click and save as, my pc wants to save it as a .jpg file.

Anyone experiencing the same issue AND found a solution?
OR does Kartris just not render transparent .png files?

Image displayed in cart:
http://forum.kartris.com/Uploads/Images/0439705f-0be2-4494-b96a-da33.JPG
Image I uploaded:
http://forum.kartris.com/Uploads/Images/e8192f46-c4b3-4103-bf07-7a75.png
By Paul - Thu 13 Feb 2014
It is something we have experimented with. If you look near the foot of image.aspx, you can see this code:

            'In theory this lets us output thumbnails
'in the original format, but PNGs don't
'seem to work reliably
'Select Case FInfo.Extension.ToUpper
' Case ".PNG"
' bmpImage.Save(Response.OutputStream, ImageFormat.Png)
' Case ".GIF"
' bmpImage.Save(Response.OutputStream, ImageFormat.Gif)
' Case Else
' bmpImage.Save(Response.OutputStream, ImageFormat.Jpeg)
'End Select


We didn't get it working reliably, but you can experiment with this. The code is open for this reason; there are also various ways to handle images, so it may be possible that rewriting other parts of this file to use alternative image and graphics methods may resolve this.
By RBaker - Fri 14 Feb 2014
Awesome Big Cheese. I uncommented the select statement and all is good now. Thanks!
By djjohnson - Fri 2 May 2014
Did you ever get .PNG images to show up correctly with transparency? I uncomment the section and did a build and same results.
By djjohnson - Sat 3 May 2014
I just ended up converting the .png's to .jpg's.
By Paul - Sun 4 May 2014
I know we had problems when we tested the code ourselves, which was why we kept it but commented it out. Not sure if the issue is the specific format of PNGs or the server image handling components. Ideally we'd like to switch to PNG as the default format, but the present issues mean JPG is probably safer - though not quite as good.