Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNGCheck Error #16

Open
Moocow9m opened this issue Jun 14, 2019 · 6 comments · May be fixed by #17
Open

PNGCheck Error #16

Moocow9m opened this issue Jun 14, 2019 · 6 comments · May be fixed by #17

Comments

@Moocow9m
Copy link

Output of PNGCheck:
File: ..\..\OneDrive\Desktop\elephant.png (379013 bytes) ..\..\OneDrive\Desktop\elephant.png: invalid chunk name "" (00 00 00 00) ..\..\OneDrive\Desktop\elephant.png illegal (unless recently approved) unknown, public chunk ..\..\OneDrive\Desktop\elephant.png: invalid chunk name "" (00 00 00 00) ..\..\OneDrive\Desktop\elephant.png illegal (unless recently approved) unknown, public chunk ..\..\OneDrive\Desktop\elephant.png: invalid chunk name "" (00 00 00 00) ..\..\OneDrive\Desktop\elephant.png illegal (unless recently approved) unknown, public chunk ..\..\OneDrive\Desktop\elephant.png: invalid chunk name "" (00 00 00 00) ..\..\OneDrive\Desktop\elephant.png illegal (unless recently approved) unknown, public chunk ..\..\OneDrive\Desktop\elephant.png: invalid chunk name "╥ⁿσ�" (ffffffd2 fffffffc ffffffe5 02) ..\..\OneDrive\Desktop\elephant.png illegal reserved-bit-set chunk ╥ⁿσ� ..\..\OneDrive\Desktop\elephant.png: invalid chunk name Pb" (15 08 50 62) ..\..\OneDrive\Desktop\elephant.png illegal critical, safe-to-copy chunkPb ..\..\OneDrive\Desktop\elephant.png invalid chunk length (too large) ERROR: ..\..\OneDrive\Desktop\elephant.png
Original file: https://cdn.discordapp.com/attachments/588735889325162496/588954686279909377/elephant.png
Optimized file: https://cdn.discordapp.com/attachments/588735889325162496/588954899363135498/temp.0.2801077039369998-0.3276898964993583elephant.pngout.png

Some decoders fail on the optimized image and I "assume" this is why...

@Moocow9m Moocow9m changed the title PNGCh PNGCheck Error Jun 14, 2019
@depsypher
Copy link
Owner

Looks like the original is an apng: https://en.wikipedia.org/wiki/APNG

According to that spec, the first frame follows the regular png spec, and all the other frames of the animation are stored in private ancillary chunks. Pngtastic looks to have optimized the first frame and thrown all the others away, which seems reasonable to me.

The optimized file shows this output from pngcheck for me:

> 18:04:00 fluxcapacitor:~/Downloads$ pngcheck -v temp.0.2801077039369998-0.3276898964993583elephant.pngout.png 
zlib warning:  different version (expected 1.2.8, using 1.2.11)

File: temp.0.2801077039369998-0.3276898964993583elephant.pngout.png (12008 bytes)
  chunk IHDR at offset 0x0000c, length 13
    480 x 400 image, 32-bit RGB+alpha, non-interlaced
  chunk IDAT at offset 0x00025, length 11951
    zlib: deflated, 32K window, maximum compression
  chunk IEND at offset 0x02ee0, length 0
No errors detected in temp.0.2801077039369998-0.3276898964993583elephant.pngout.png (3 chunks, 98.4% compression).

I imagine the original file might fail in some decoders (ones that don't support apng), but the optimized file should render (first frame only, no animation) in any png decoder. It renders ok for me in Preview.app on the mac and in Chrome.

@Moocow9m
Copy link
Author

Moocow9m commented Jun 15, 2019

Well, for example, the decoder Discord uses fails to load to optimized image(and their decoder does not support apng and it renders first frame fine on original). Though the more I think about it, it could be the compressor used. Maybe its the fact the newer zopfli compression may not be supported so it may be a discord bug... even though its first release was 2013...

@depsypher
Copy link
Owner

Odd, I just tried both the images you posted here in Discord and they both seem to work for me.

Could be a Mac versus PC issue in Discord, but doesn't seem to be a pngtastic bug to me, or at least I can't reproduce it.

@depsypher
Copy link
Owner

depsypher commented Jun 15, 2019 via email

@Moocow9m
Copy link
Author

Moocow9m commented Jun 16, 2019

Should native code be reintroduced as optional(either build-time or run-time setting) until the pure java impl is stable? I plan to pull the last commit where native code was still in use and see if the issue is still present tomorrow. Also, mac 's discord png code works with the image? That is quite interesting.

@Moocow9m
Copy link
Author

After testing, native code ran successfully and loaded by discord perfectly.

@Moocow9m Moocow9m linked a pull request Jun 16, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants