Category image not displaying properly - PNG

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10338

I created a PNG of an image I wish to use as a category image (150px X 150px) and added it to the category. However, the image being displayed is just a solid red block, the same color as the text in the PNG itself. In the back-end, when I click on the image itself, the popup shows the correct image. However, in both the front and back-end all I am seeing is a red block.

You can see the issue here:

50.22.11.13/~thegragp/storefront/index.php/shop

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10339

If I create a JPG, the display is correct.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10340

The problem probably comes from the fact that the background of your png image is transparent. Could you set a background before saving it in your image software and then upload it in hikashop ?

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10341

I figured that might be it, which is why the JPG worked. However, the default images you have in there (barcode.png) have transparent backgrounds, so I am confused why mine would not work.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10344

Indeed, HikaShop should handle transparency of png images. Unless your image editing software saves it in a special way that we (or the GD library that hikashop uses for images resizing) do not support. For example, if you use a special color for transparency instead of the default one, that might cause such issue I think.

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10348

I will have to check. I generated the PNG in Photoshop. I will do some further testing and let you know what I find!

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10351

No matter what I try, I cannot get this issue to resolve itself. I am creating a transparent PNG in Photoshop, using the default transparency. I am saving it out as a PNG-24 using the regular Photoshop defaults. I created the image at 125x125, which is the size set for thumbnails in the Configuration file, so no resizing should be necessary. I still get the red block, which is layered on a white background, even though the image itself is 125x125. Weird!!

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10352

Image Info:
Format: PNG-24
Dimensions: 125w x 125h
Size: 4.09K
Settings: Non-Interlaced, Transparency on

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10353

Did you try with a different bit ratio ?
8bits maybe ?

Could you try to replace the file administrator/components/com_hikashop/helpers/image.php by the one in the archive enclosed (make a copy before in case it doesn't work) ?
I changed a bit the code for the transparency handling...That might just do it.

File Attachment:

File Name: image.zip
File Size:4 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10354

I did try 8bits, but it didn't make a difference. I will try your changed file and post my results. Thanks!!!!

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10355

No change with the updated file. Sorry!!!

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10356

Just so you know, this really is NOT a huge deal!!!

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10357

I tried with your image on my end and got the same result. I tried to save your image with paint.net and I got the logo under a black background. I also tried with a watermark with your original image and what's funny is that the watermark was below the logo but in front of the red block...
I don't know what the problem is, but there is definitely a problem with the image format which is not handled properly somewhere.

Last edit: 13 years 8 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 2
13 years 8 months ago #10358

Ha!! I guess I really did a number on it! Oh well, if you come upon a resolution - great. If not, no big deal. I will just use a standard sized JPG for my category images. Thanks, nicolas!

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 5 months ago #159658

I had the black outline image also. I realized that when i used 3rd party software to compress, it resulted in the black background or outline

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
10 years 5 months ago #159663

Thanks for your feedback, I'm sure it will help people facing the same issue ;)

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum