My blog has been moved to ariya.ofilabs.com.

Tuesday, November 09, 2010

chunks inside PNG

Here is a few minutes of hack which would hopefully help someone else:

pngchunks logo.png
File size: 5967 byte(s)

Offset    Chunk    Size
      8    IHDR      13
     33    iCCP    2627
   2672    IDAT    3271
   5955    IEND       0

Useful to quickly find out if we can further strip unnecessary chunks from the PNG image. Or even as a warming up before you fire your favorite hex viewer/editor.

It's pure, stand-alone, self-contained C code (i.e. compile using gcc -o pngchunks pngchunks.c), available at the usual X2 repository, find it under graphics/pngchunks.

2 comments:

Cyrille Berger said...

Hi,
What is the difference with the pngchunks of pngtools (http://www.stillhq.com/pngtools/) ? Usually available in any sane distro.

Ariya Hidayat said...

@Cyrille: The utilities inside pngtools are comprehensive, this one is just a quick hack.