Transferring metadata among directories loses some image info

Started by cld, April 24, 2018, 01:10:17 PM

Previous topic - Next topic

cld

Hi all,
Similar to some other posts here, I am working with images from a multispectral camera (Micasense Rededge-M). Each image corresponds to a different band (wavelength/color). Processing my images results in the loss of the image metadata, so I use the following code in the command line to transfer the metadata from all files in one directory (Z:\UAV\images) to all files in another directory (Z:\UAV\reflectance_images) where matching images have the exact same name. I am trying to transfer as much info as possible and trial and error resulted in the following code:

exiftool -tagsFromFile Z:\UAV\images\%f.tif -file:all -iptc:all -exif:all -xmp -Composite:all Z:\UAV\reflectance_images -overwrite_original

After this all the metadata I need appears to have copied over correctly. However, the next step of processing uses the file name and metadata to take each image (each image corresponds to a different band) to create a composite image with 5-bands. This is where I am getting the error "Image count mismatch" which basically means that the images are not in sets of 5.

Is there something wrong with my exiftool command that is changing the metadata in a way I don't understand?

Thanks for any help!

StarGeek

I would suggest replacing -file:all -iptc:all -exif:all -xmp -Composite:all with -all:all.

I'm guessing that the error message of "Image count mismatch" isn't from exiftool?  What program is returning that error?
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

cld

Hi StarGeek,
Thank you for your reply. I have tried your suggestion, but for some reason when I use "-all:all" none of the metadata transfers over. I am unsure why this is.

The error message "Image count mismatch" is from Agisoft's Photoscan. After some troubleshooting, I am sure my issue is with the exiftool command and not Photoscan. For some reason, when trying to use it to "batch transfer" metadata I'm having issues with a subset of images. The number of images with errors ranges from 3 - 20 and they are different images each time based on my test runs. The most prevalent image error is "error reading image data". But the original files are fine upon inspection. I should also note that both directories are located on a network server.

Any recommendations or insights into using exiftool commands to batch process and avoiding errors?

Thanks!

Phil Harvey

Quote from: cld on May 02, 2018, 01:57:35 PM
for some reason when I use "-all:all" none of the metadata transfers over. I am unsure why this is.

Could you show the output of the command you used with -v3 added?:

... like this: exiftool ARGS > out.txt, then post out.txt.

QuoteThe most prevalent image error is "error reading image data".

I have searched the ExifTool code and can't find where that error could be issued.  Is that the exact error given?  Please post the output of the command with -v3 added.
...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 ($).

cld

Hi Phil,
Thank you for your help. I ran the following as you suggested:

exiftool -tagsFromFile Z:\UAV\images\%f.tif -file:all -iptc:all -exif:all -xmp -Composite:all Z:\UAV\reflectance_images -overwrite_original -v3 > out.txt

The resulting out.txt is too large to attach to this post, so I will send as a message.

Yes, "error reading image data" was the exact message I got when running the command above without "-v3 > out.txt".

Thanks again. Much appreciated.

Phil Harvey

I don't know why you say none of the metadata transfers over.  A lot of tags were copied, but in all cases I saw the destination file already contained all tags with the same values you were copying.

Also, it would be useful if you could isolate the image data error down to a single file.  It is likely that file is corrupted.

- 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 ($).