Jetpack: Photon messed up PNG images with transparency

Created on 24 Dec 2017  路  3Comments  路  Source: Automattic/jetpack

Steps to reproduce the issue

  1. Upload the following PNG file to a self-hosted site (one of two files, I am uploading the ZIP file also to make sure GitHub not change anything in the PNG file).
  1. Add it to a post content.

  2. Enable Photon.

What I expected

Normally, like this (without Photon active)
image

What happened instead

There is a pink color for transparency (when Photon is active)
image

Other info:

Tix: 851149-zen

Photon [Pri] Normal [Type] Bug

Most helpful comment

The source image is not specifying the correct colour type according to the PNG specification. If you run (you will need GraphicsMagick installed):

gm identify -verbose Image.png | grep 'Png:IHDR.color-type'

You will see it is set to 2, but it should be set to 6. Ref: https://www.w3.org/TR/PNG-Chunks.html

To fix the source image, you will need to re-save by using Gimp to export it as PNG (or some similar tool) and then re-upload the image. Magically the background will be transparent, because Gimp fixes the issue automatically. You can confirm this via CLI too, by performing the same command as above and you will see the type is now 6.

@arunsathiya if all your PNGs are showing this same defect, please can you send me your test site URL so I can check them out. Thanks.

All 3 comments

Can confirm this is happening with me too. Tried it last night, and yes Photon shows a pink background for all my PNG images.

cc @darthhexx

The source image is not specifying the correct colour type according to the PNG specification. If you run (you will need GraphicsMagick installed):

gm identify -verbose Image.png | grep 'Png:IHDR.color-type'

You will see it is set to 2, but it should be set to 6. Ref: https://www.w3.org/TR/PNG-Chunks.html

To fix the source image, you will need to re-save by using Gimp to export it as PNG (or some similar tool) and then re-upload the image. Magically the background will be transparent, because Gimp fixes the issue automatically. You can confirm this via CLI too, by performing the same command as above and you will see the type is now 6.

@arunsathiya if all your PNGs are showing this same defect, please can you send me your test site URL so I can check them out. Thanks.

Was this page helpful?
0 / 5 - 0 ratings