New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 836920 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

tools/resources/optimize-png-files.sh breaks APNGs

Project Member Reported by scroggo@chromium.org, Apr 25 2018

Issue description

See  issue 835197 

optimize-png-files.sh runs pngcrush, but does not take into account that a file is an APNG. So, for example, a png might not have transparency in frame 0, but need it for composing frames. The PNG is crushed by changing its color type to RGB (instead of RGB + alpha), resulting in an animation that does not look as intended.

The simplest solution would be to skip files that are APNGs. They can be identified by acTL chunks. But it looks like optimize-png-files.sh doesn't look at the data directly, and I didn't see (in a quick look) how to do any detection with pngcrush, so we may need to write more code to detect acTL.

Not sure who to assign this to. Added people from the original bug, plus agrieve@chromium.org who is an OWNER of the script's directory.
 

Comment 1 by pbos@chromium.org, Apr 25 2018

It looks like perhaps my version of pngcrush is old (or that the -o 1 flag is really important).

Someone else was able to run it without breaking the apngs under abstract/: crrev.com/c/901961

I don't know the scope of this but the fact that someone else has run it without breaking ChromeOS feels a bit better.
Cc: dbeam@chromium.org dbeam@google.com
FWIW, the CL linked to in #1 states:

"Something that is more likely to break: animation"

So it may have just gotten lucky?

Comment 3 by dbeam@chromium.org, Apr 27 2018

Cc: -dbeam@google.com

Comment 4 by dbeam@chromium.org, Apr 27 2018

re: lucky -- i inspected hundreds of pngs for any type of failures (most of the animations were broken, so I reverted those case-by-case).

Comment 5 by pbos@chromium.org, Apr 30 2018

Ouch that's scary. Thanks for chiming in, I thought you were just lucky or running a more recent pngcrush.

Sign in to add a comment