Help save net neutrality! Learn more.
Close

#25 Inserting text chunks do not work

None
closed
None
5
2014-10-23
2007-03-12
Anonymous
No

-itxt switch does not insert iTXt chunk. Furthermore, manual does not explain the parameters used by the switch.

-text switch does not add tEXt chunk to output, even though it says 'Added a tEXt chunk'. See attachment pcp.

-zitxt does not add zTXt chunk. Unlike -text switch, the activity wasn't even reported.

-ztxt does not add zTXt chunk to output, even though it says 'Added a zTXt chunk'.

Discussion

  • Nobody/Anonymous

    pcp.png

     
  • Glenn Randers-Pehrson

    Logged In: YES
    user_id=7859
    Originator: NO

    Your pcp.png looks OK to me. It has tEXt and iTXt chunks:
    Reading IHDR chunk, length = 13.
    Reading sRGB chunk, length = 1.
    Reading gAMA chunk, length = 4.
    Reading cHRM chunk, length = 32.
    Reading IDAT chunk, length = 29917.
    Reading cmOD chunk, length = 0.
    Reading cpIp chunk, length = 16384.
    Reading iTXt chunk, length = 45.
    Reading tEXt chunk, length = 45.
    Reading IEND chunk, length = 0.

    I don't see a zTXt chunk though.

     
  • Nobody/Anonymous

    Logged In: NO

    Here's another example.

    junk.png is pretty compressed already, it has 2 tEXt chunks already.

    ./pngcrush -text b "Foo" "Bar" junk.png junk2.png

    Recompressing junk.png
    Total length of data found in IDAT chunks = 12670
    Added a tEXt chunk.
    unknown chunk handling done.
    IDAT length with method 1 (fm 0 zl 4 zs 0) = 43249
    Added a tEXt chunk.
    IDAT length with method 2 (fm 1 zl 4 zs 0) = 42772
    Added a tEXt chunk.
    IDAT length with method 3 (fm 5 zl 4 zs 1) = 18732
    Added a tEXt chunk.
    IDAT length with method 9 (fm 5 zl 2 zs 2) = 139108
    Added a tEXt chunk.
    IDAT length with method 10 (fm 5 zl 9 zs 1) = 13660
    Best pngcrush method = 0 (fm 5 zl 9 zs 1) for junk2.png
    (no IDAT change)
    (no filesize change)

    CPU time used = 0.480 seconds (decoding 0.010,
    encoding 0.460, other 0.010 seconds)

    $ diff junk.png junk2.png
    $ #nothing.. they are the same.
    $ strings junk2.png | grep "Foo"
    $ #nothing... "Foo" is not present

    Since it was already optimally compressed I think it thought it was "done" and forgot to write out the next tEXt chunk and just copied the original (??)

    thanks for a nice program

     
  • Nobody/Anonymous

    Logged In: NO

    the "thanks" was not suppose to sound snotty! I love PNGCrush, except for this little bugger.
    Post if you need more details on the problem.

    The version 1.6.4

     
  • Glenn Randers-Pehrson

    Logged In: YES
    user_id=7859
    Originator: NO

    I took your "thanks" as genuine.

    Try using the -force option when adding chunks to an already-compressed PNG.

    Glenn

     
  • Nobody/Anonymous

    Please do fix this bug!

    PNGcrush is a great tool except for the metadata/keyword bug. I would appreciate it if a fix was found.

     
  • Glenn Randers-Pehrson

    Fixed in pngcrush-1.7.29

     
  • Glenn Randers-Pehrson

    • status: open --> closed
    • Group: -->
     

Log in to post a comment.