Skip to content

image/png does not decode transparency correctly with certain images #439

@rsaarelm

Description

@rsaarelm
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Decode the attached png image using image/png
2. Read the alpha value of the top left pixel (0, 0)

What is the expected output? What do you see instead?

Either the image should be rejected as having an unsupported format, or the
alpha value should be read as 0, since the pixel is transparent. Instead,
the image is loaded correctly, but the alpha value is 255, and the pixel is
opaque.

What is your $GOOS?  $GOARCH?

linux 386

Which revision are you using?  (hg identify)

2fa0e9e84efd tip

Please provide any additional information below.

Image "ass_char_tran.png" from here
http://forums.tigsource.com/index.php?topic=8834.05 , optimized with optipng.

Attachments:

  1. pngprint.go (260 bytes)
  2. a.png (5301 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions