messing with ICC profile information

Started by bobo, September 20, 2020, 08:45:44 PM

Previous topic - Next topic

bobo

Heya,

I have a ton of PNGs from iOS that I want to change the ICC date in.

I understand that ICC header tags are not writable - so I wanted to make a script to get the job done for my use case.

What I did so far was:
1 -  backup the template profile from an iOS PNG: exiftool -icc_header -b 'template_png' > profile.icc

2 - open the profile in a hex editor and zero out bytes 24-35

3 - write it back to PNG which does not have any profile: exiftool '-icc_profile<=/profile.icc' my_png

4 - read back the profile on the new PNG
[ICC-header]    Profile Date Time               : 0000:00:00 00:00:00


Wohoo! Date and time is zero'd out ... I don't exactly understand the format but that can be reverse engineered.

So my plan is to write a script to take a PNG, extract the existing date and time with ExifTool, inject it into the template profile and write back using ExifTool.

Before I set on this adventure, I wanted to see if there is an easier way to get this done with ExifTool.

Thanks,

- Borna

bobo

I actually don't need to do this anymore ... but its easy enough to script modifying the bytes in using dd on linux/osx if this is useful for anyone trying to modify the profiles in the future.

printf '\xYY\xcMM\xcDD\xHH\xcMM\xcSS\' | dd of=icc_profile bs=1 seek=24 count=12 conv=notrunc

Then write back to profile to the file.