Main Menu

Write Mode

Started by lei, October 01, 2022, 11:10:48 AM

Previous topic - Next topic

lei

Hi Phil,

When I copied GPS data from one file to another, I used -wm cg option, not wanting to overwrite existing GPS data. However, some of my GPS data was still overwritten. Then I checked the existing GPS data, and found that it's not complete - it's got only latitude and longitude, nothing else.

So, I'm wondering how -wm cg checks the tags before deciding whether to overwrite or not. Or, maybe you would like to add more conditions.

Thanks in advance

StarGeek

Can you give a couple example images where this happens?  And what is the exact command you are using?

The -wm (-writeMode) option with cg will not overwrite existing tags, only create new ones.  I suspect that this might be a FAQ #3, where your source tags and not in the same location as the target tags.  For example, if your source has only XMP, such as an XMP sidecar, depending upon your command, exiftool would copy the data into the EXIF gps tags.  And because the EXIF gps are split into coordinates GPSLatitude/GPSLongitude and reference directions GPSLatitudeRef/GPSLongitudeRef such a copy would only fill the coordinates and not the reference directions.

You might want to use the xmp2gps.args if you are copying the XMP gps data.
* 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).

lei

Hi StarGeek,

As usual, thanks very much for your reply.

When I was preparing this post, I found my original one was not completely correct.

C:\Users\lei\Desktop\GPS Test>et -a -s -G1 -*gps* .
======== ./gps_dest.jpg
[GPS]           GPSLatitudeRef                  : South
[GPS]           GPSLatitude                     : 34 deg 14' 11.21"
[GPS]           GPSLongitudeRef                 : East
[GPS]           GPSLongitude                    : 141 deg 10' 4.49"
[GPS]           GPSAltitudeRef                  : Above Sea Level
[GPS]           GPSAltitude                     : 38 m
[Composite]     GPSAltitude                     : 38 m Above Sea Level
[Composite]     GPSLatitude                     : 34 deg 14' 11.21" S
[Composite]     GPSLongitude                    : 141 deg 10' 4.49" E
[Composite]     GPSPosition                     : 34 deg 14' 11.21" S, 141 deg 10' 4.49" E
======== ./gps_src.jpg
[GPS]           GPSVersionID                    : 2.2.0.0
[GPS]           GPSLatitudeRef                  : South
[GPS]           GPSLatitude                     : 33 deg 56' 40.07"
[GPS]           GPSLongitudeRef                 : East
[GPS]           GPSLongitude                    : 151 deg 13' 24.26"
[GPS]           GPSAltitudeRef                  : Above Sea Level
[GPS]           GPSAltitude                     : 44 m
[GPS]           GPSDateStamp                    : 2022:09:23
[GPS]           GPSTimeStamp                    : 07:13:35
[GPS]           GPSProcessingMethod             : CELLID
[Composite]     GPSAltitude                     : 44 m Above Sea Level
[Composite]     GPSDateTime                     : 2022:09:23 07:13:35Z
[Composite]     GPSLatitude                     : 33 deg 56' 40.07" S
[Composite]     GPSLongitude                    : 151 deg 13' 24.26" E
[Composite]     GPSPosition                     : 33 deg 56' 40.07" S, 151 deg 13' 24.26" E
    1 directories scanned
    2 image files read


C:\Users\lei\Desktop\GPS Test>et -tagsfromfile gps_src.jpg -gps:all -wm cg gps_dest.jpg
    1 image files updated


C:\Users\lei\Desktop\GPS Test>et -a -s -G1 -*gps* .
======== ./gps_dest.jpg
[GPS]           GPSVersionID                    : 2.2.0.0
[GPS]           GPSLatitudeRef                  : South
[GPS]           GPSLatitude                     : 34 deg 14' 11.21"
[GPS]           GPSLongitudeRef                 : East
[GPS]           GPSLongitude                    : 141 deg 10' 4.49"
[GPS]           GPSAltitudeRef                  : Above Sea Level
[GPS]           GPSAltitude                     : 38 m
[GPS]           GPSTimeStamp                    : 07:13:35
[GPS]           GPSProcessingMethod             : CELLID
[GPS]           GPSDateStamp                    : 2022:09:23
[Composite]     GPSAltitude                     : 38 m Above Sea Level
[Composite]     GPSDateTime                     : 2022:09:23 07:13:35Z
[Composite]     GPSLatitude                     : 34 deg 14' 11.21" S
[Composite]     GPSLongitude                    : 141 deg 10' 4.49" E
[Composite]     GPSPosition                     : 34 deg 14' 11.21" S, 141 deg 10' 4.49" E
======== ./gps_src.jpg
[GPS]           GPSVersionID                    : 2.2.0.0
[GPS]           GPSLatitudeRef                  : South
[GPS]           GPSLatitude                     : 33 deg 56' 40.07"
[GPS]           GPSLongitudeRef                 : East
[GPS]           GPSLongitude                    : 151 deg 13' 24.26"
[GPS]           GPSAltitudeRef                  : Above Sea Level
[GPS]           GPSAltitude                     : 44 m
[GPS]           GPSDateStamp                    : 2022:09:23
[GPS]           GPSTimeStamp                    : 07:13:35
[GPS]           GPSProcessingMethod             : CELLID
[Composite]     GPSAltitude                     : 44 m Above Sea Level
[Composite]     GPSDateTime                     : 2022:09:23 07:13:35Z
[Composite]     GPSLatitude                     : 33 deg 56' 40.07" S
[Composite]     GPSLongitude                    : 151 deg 13' 24.26" E
[Composite]     GPSPosition                     : 33 deg 56' 40.07" S, 151 deg 13' 24.26" E
    1 directories scanned
    2 image files read

As we can see, the GPS info in gps_dest.jpg is not complete compared to gps_src.jpg. ExifTool only copied those tags that were missing, and didn't copy those that already existed. Yesterday, in my original question, I thought it copied over everything (the whole GPS set) without checking/comparing carefully. My bad!

Even though ExifTool does the right thing, it's still not acceptable to me in this case 'coz I don't want to mix up GPS info from two files (locations). I think I'll add a conditional test like -if "$gpslatitude" when copying.

BTW, these two photos were taken using the same Galaxy s20+, and I didn't edit them a bit. Don't know why the GPS data sets are different. If anyone know the reason, please tell me. Thanks.