exiftool / exiftool

ExifTool meta information reader/writer

Home Page:https://exiftool.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

-TagsFromFile -Description inserts zTXt data after IDAT

Gamer025 opened this issue · comments

Im currently trying to automate the process of copying a zTXt chunk from one file to another file.
For this im using the command:

exiftool.exe -z -TagsFromFile D:\path\to\file\areas.dmi -Description D:\path\to\file\areas.dmi.new

This results in the zTXt being copied to the new file but after the IDAT chunks.

.dmi is format used by a old game engine called Byond but its literally just a png file with zTXt Keyword "Description" being used to associate the image data with sprites in game.
However if the zTXt chunk comes after the IDAT chunks the game engine fails to read the file.

Original file seen by the programm TweakPNG:
image
My modified file to which I want to add the zTXt tag after using the mentioned command:
image
The sRGB, gAMA etc. comes from me and I want the zTXt chunk somewhere between IHDR and IDAT

I read that in earlier version you had to use PNGEarlyXMP for exiftool to write the data before IDAT but apparently in newer versions this should happen automatically.

Im using exiftools version 11.62.

The PNGEarlyXMP applied only to XMP. The current version always writes XMP before IDAT. Other zTXt chunks are written after IDAT. It looks like I maybe need to extend this to zTXt (and other text chunks). I'll look into this.

ExifTool 11.63 (just released) writes all text chunks before IDAT.

I just tested the new version and now it works just like it need.
Thank you very much for your very fast response and the fast patch.

Great, thanks for the feedback.