Opened 2 years ago

Closed 19 months ago

#4816 closed defect (fixed)

png: wrong alpha detection

Reported by: pszemus Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: png alpha regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: alpha channel isn't detected, thus it's being lost after conversion.
How to reproduce:

$ ~/ffmpeg/ffmpeg -i http://storage2.sportowefakty.pl.sds.o2.pl/tags/55c99e750a5fd6_50314226.png
ffmpeg version N-74416-gacbd78a Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --prefix=/home/pszemus/ffmpeg/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable-libx264 --pkg-config-flags=--static --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/inc --extra-ldflags='-L/opt/WP/common.libs/lib -ldl'
  libavutil      54. 30.100 / 54. 30.100
  libavcodec     56. 57.100 / 56. 57.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 33.100 /  5. 33.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, png_pipe, from 'http://storage2.sportowefakty.pl.sds.o2.pl/tags/55c99e750a5fd6_50314226.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgb24(pc), 330x330, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

FFmpeg detects pixel format as rgb24(pc) ignoring the alpha channel.
GraphicsMagick?, on the other hand, displays information about 4 channels:

$ gm identify -verbose http://storage2.sportowefakty.pl.sds.o2.pl/tags/55c99e750a5fd6_50314226.png
Image: /tmp/gmIhmThX
  Format: PNG (Portable Network Graphics)
  Geometry: 330x330
  Class: DirectClass
  Type: true color with transparency
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      8 bits
    Green:    8 bits
    Blue:     8 bits
    Opacity:  1 bits
  Channel Statistics:
    Red:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                       36.07 (0.1414)
      Standard Deviation:         85.97 (0.3371)
    Green:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                       41.85 (0.1641)
      Standard Deviation:         83.66 (0.3281)
    Blue:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                       19.49 (0.0764)
      Standard Deviation:         56.10 (0.2200)
    Opacity:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                      194.13 (0.7613)
      Standard Deviation:        108.70 (0.4263)
  Opacity: (  0,  0,  0,255)      #000000FF
  Filesize: 43.3Ki
  Interlace: No
  Orientation: Unknown
  Background Color: white
  Border Color: #DFDFDF00
  Matte Color: #BDBDBD00
  Page geometry: 330x330+0+0
  Compose: Over
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Png:IHDR.color-type-orig: 2
  Png:IHDR.bit-depth-orig: 8
  Signature: 690a475a4154c72e21cb56c6864e8b37780716ddc7d028661724d29ae6e7f7ac
  Tainted: False

Attachments (1)

storage2.sportowefakty.pl.sds.o2.pl_tags_55c99e750a5fd6_50314226.png (43.3 KB) - added by pszemus 2 years ago.
Remote file attached

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by pszemus

Remote file attached

comment:1 Changed 2 years ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

This has been fixed recently.

comment:2 Changed 2 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords png alpha added
  • Version changed from unspecified to git-master

comment:3 Changed 2 years ago by pszemus

Could you send me the commit id?

comment:5 Changed 20 months ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important
  • Resolution fixed deleted
  • Status changed from closed to reopened

Broken since 72eaf726236331e739952806a5fe47b40165ac76

$ ffmpeg -i ../Samples/tickets/ticket4816/55c99e750a5fd6_50314226.png
ffmpeg version N-78994-gbd2cc3c Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.100 / 57. 28.100
  libavformat    57. 28.101 / 57. 28.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, png_pipe, from '../Samples/tickets/ticket4816/55c99e750a5fd6_50314226.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgb24(pc), 330x330, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

comment:6 Changed 19 months ago by michael

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.