ExifTool Forum

ExifTool => Newbies => Topic started by: theboyk on July 28, 2016, 10:12:05 AM

Title: Some tags not being copied when trying to copy from one JPG to another?
Post by: theboyk on July 28, 2016, 10:12:05 AM
Hi there,

I'm trying to work with some edits spherical still photography and uploading to Google Street View and Facebook (now that Facebook supports 360 images). Running into a small issue because of editing software I use (Snapseed) removes some of the meta data related to the image being a spherical image (in particular, GPANO tags). Without these tags in place, Google Street View and Facebook don't recognize the images as 360/spherical images (and either reject the image or just post as a regular image).

Right now, my only work-around relies on Photoshop. Using Photoshop, I have to export the .XMP from the original image and then import that .XMP file into the edited version of the image (and I need to select "Clear existing properties and replace with template properties"). Then, when I upload the edited image, it's recognized as a spherical image.

I was hoping to use exiftool to automate this process (and not need Photoshop).

Basically, I want to wipe the meta data from the destination and replace it with the source's data. This is what I tried...

exiftool -all= -tagsfromfile original.JPG -all:all destination.JPG

But, when I do this, not all of the tags in the source are copied to the destination? For example, this is the relevant data that I need to copy (from the original JPG):

<GPano:ExposureLockUsed>False</GPano:ExposureLockUsed>
<GPano:StitchingSoftware>Street View - 2.3.0</GPano:StitchingSoftware>
<GPano:CaptureSoftware>Street View - 2.3.0</GPano:CaptureSoftware>
<GPano:CroppedAreaLeftPixels>0</GPano:CroppedAreaLeftPixels>
<GPano:CroppedAreaTopPixels>392.3809523809524</GPano:CroppedAreaTopPixels>
<GPano:CroppedAreaImageWidthPixels>5120</GPano:CroppedAreaImageWidthPixels>
<GPano:CroppedAreaImageHeightPixels>1768.571428571428</GPano:CroppedAreaImageHeightPixels>
<GPano:FullPanoWidthPixels>5120</GPano:FullPanoWidthPixels>
<GPano:FullPanoHeightPixels>2560</GPano:FullPanoHeightPixels>
<GPano:ProjectionType>equirectangular</GPano:ProjectionType>
<GPano:UsePanoramaViewer>True</GPano:UsePanoramaViewer>
<GPano:PoseHeadingDegrees>194</GPano:PoseHeadingDegrees>
<GPano:FirstPhotoDate>2016:07:27 13:52:55-04:00</GPano:FirstPhotoDate>
<GPano:LastPhotoDate>2016:07:27 13:54:24-04:00</GPano:LastPhotoDate>
<GPano:SourcePhotosCount>34</GPano:SourcePhotosCount>


But, after running the above command, the meta data in the destination looks like this:

<GPano:CaptureSoftware>Street View - 2.3.0</GPano:CaptureSoftware>
<GPano:CroppedAreaImageWidthPixels>5120</GPano:CroppedAreaImageWidthPixels>
<GPano:CroppedAreaLeftPixels>0</GPano:CroppedAreaLeftPixels>
<GPano:ExposureLockUsed>False</GPano:ExposureLockUsed>
<GPano:FirstPhotoDate>2016-07-27T13:52:55</GPano:FirstPhotoDate>
<GPano:FullPanoHeightPixels>2560</GPano:FullPanoHeightPixels>
<GPano:FullPanoWidthPixels>5120</GPano:FullPanoWidthPixels>
<GPano:LastPhotoDate>2016-07-27T13:54:24</GPano:LastPhotoDate>
<GPano:PoseHeadingDegrees>194</GPano:PoseHeadingDegrees>
<GPano:ProjectionType>equirectangular</GPano:ProjectionType>
<GPano:SourcePhotosCount>34</GPano:SourcePhotosCount>
<GPano:StitchingSoftware>Street View - 2.3.0</GPano:StitchingSoftware>
<GPano:UsePanoramaViewer>True</GPano:UsePanoramaViewer>


For some reason, the following two tags aren't being copied...

<GPano:CroppedAreaTopPixels>392.3809523809524</GPano:CroppedAreaTopPixels>
<GPano:CroppedAreaImageHeightPixels>1768.571428571428</GPano:CroppedAreaImageHeightPixels>


Without these two tags, the upload fails. If I manually insert this data into the destination, the upload succeeds.

Any ideas as to why these two tags aren't been copied from the original to the destination?

Thanks,
Kristin.
Title: Re: Some tags not being copied when trying to copy from one JPG to another?
Post by: Phil Harvey on July 28, 2016, 10:18:14 AM
Hi Kristin,

This is because ExifTool expects an "integer" value for these tags.  You will see warnings like this if you add the -v3 option:

Not an integer for XMP-GPano:CroppedAreaTopPixels

I will change this to support "real" values in the next release (10.25), but until then you may be able to work around the problem by copying the XMP as a block.  This will overwrite all XMP in the target image, but will copy all XMP verbatim from the source image:

exiftool -tagsfromfile original.JPG -xmp destination.JPG

- Phil
Title: Re: Some tags not being copied when trying to copy from one JPG to another?
Post by: theboyk on July 28, 2016, 10:39:56 AM
Ah, makes sense. And thanks—copying the block totally worked! Thanks!