How to get exact copy of metadata?

Started by Jossie, August 04, 2017, 03:20:54 AM

Previous topic - Next topic

Jossie

Good morning,

raw data from my scanner come as three-page TIFs (RGB full size, preview small image, IR full size). The scan information is contained in the metadata for further image processing with the scan software.
I want to make some changes to the pixel values in the RGB- and the IR-image and still be possible to use this updated TIF with the scan software. So I split the original image into its sub-images, make the changes with imageJ and then recombine the updated images into a new 3-page TIF with imagemagick. So far so good. Then I  used EXIFtool to copy the metadata from the original raw data file to the new updated image with
exiftool -tagsfromfile original.tif -all:all updated.tif.

Unfortunately, the scan software does not recognize the third page in the updated image, although it is there. So there must be a difference between the updated and the original TIF, perhaps in the metadata.

How could I use EXIFtool to remove all metadata from the updated image (it inherits some metadata from the single page files when combining them with imagemagick) and then make an identical copy of the metadata from the original image to the updated image?

Many thanks in advance for any help.

Best wishes

Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

Your command should copy all writable and non-protected tags to updated.tif

Try comparing the output of this command for the original and updated files to see what is different:

exiftool -a -u -G1 FILE

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Jossie

Hi Phil,

thanks a lot for your reply. Using the suggested command shows quite a few differences.

Most notably, the tag "Subfile Type" is different between the original and the updated image. This is for all pages.

In the updated image it always says "Single page of multi-page image", whereas in the original it was "Full-resolution Image" for page 1 (IFD0), "Reduced-resolution image" for page 2 (IFD1), and "Transparency mask" for page 3 (IFD2). I strongly suspect, that these differences cause at least part of the problem.

Is it possible to change these tags for IFD0 to IFD2?

But these are not all the differences, there are quite more. E.g. there is "[IFD0]   Exif 0x89ab : 11 100 130 16 0 0 0 0" in the original, which I do not see in the updated image.

Is there no way to just remove all tags in the updated image and copy everything from the original? This would be the easiest solution.

Hermann-Josef

Phil Harvey

See the EXIF tags documentation for a complete list of writable EXIF tags.  The ones with exclamation points in the Writable column aren't copied by default.  You can specify the particular IFD when writing, eg:

exiftool -ifd2:subfiletype="Transparency mask" ...

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Jossie

Hi Phil,

in the meantime I experimented with the GUI and managed to change the SubfileType tags into the ones from the original file. And this was the trick! Now I can open the updated image in the scanner software and it also recognizes the IR-channel. Now I am free to improve the scans and still use the dedicated software for image processing.

Thank you so much for your help and your extremely useful software!

Best wishes

Hermann-Josef