ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: dronesurveyor on October 02, 2022, 10:55:15 AM

Title: Changing Order of Exif Data and also Description
Post by: dronesurveyor on October 02, 2022, 10:55:15 AM
Hi There

So I have 1000 images from a survey and I need to change the order of the line items and also change some of the wording contained:

From this:

XP Comment                      : PPK Geotag         
PrintIM Version                 : 0300         
Compression                     : JPEG (old-style)         
Thumbnail Offset                : 34748         
Thumbnail Length                : 8532         
XMP Toolkit                     : Image::ExifTool 12.42         
GPSXY Accuracy                  : 0.01         
GPSZ Accuracy                   : 0.0148         
Horiz CS                        : EPSG:4326         
IMU Pitch Accuracy              : 2         
IMU Roll Accuracy               : 2         
IMU Yaw Accuracy                : 3         
Pitch                           : 2.39940021810251         
Roll                            : 0.669602231028915         
Vert CS                         : EPSG:5773         
Yaw                             : -17.6077700904737


To this:

GPS Version ID                  : 2.2.0.0         
GPS Latitude Ref                : North         
GPS Longitude Ref               : West         
GPS Altitude Ref                : Above Sea Level         
GPS Map Datum                   : WGS84         
PrintIM Version                 : 0300         
Compression                     : JPEG (old-style)         
Image Description               :          
Thumbnail Offset                : 34550         
Thumbnail Length                : 6408         
XMP Toolkit                     : XMP Core 6.0.0         
Creator Tool                    : DSC-RX1RM2 v1.00         
GPSXY Accuracy                  : 0.03         
GPSZ Accuracy                   : 0.03         
Horiz CS                        : EPSG:4326         
Vert CS                         : ellipsoidal         
Roll                            : -2.46236388         
Pitch                           : -4.68445936         
Yaw                             : -115.78370024         
Title: Re: Changing Order of Exif Data and also Description
Post by: Phil Harvey on October 02, 2022, 10:59:46 AM
This command will get you the order you want, but I don't know what "wording" you want changed:

exiftool -GPSVersionID -GPSLatitudeRef -GPSLongitudeRef -GPSAltitudeRef -GPSMapDatum -PrintIMVersion -Compression -ImageDescription -ThumbnailOffset -ThumbnailLength -XMPToolkit -CreatorTool -GPSXYAccuracy -GPSZAccuracy -HorizCS -VertCS -Roll -Pitch -Yaw FILE

- Phil
Title: Re: Changing Order of Exif Data and also Description
Post by: dronesurveyor on October 02, 2022, 11:04:19 AM
Quote from: Phil Harvey on October 02, 2022, 10:59:46 AMThis command will get you the order you want, but I don't know what "wording" you want changed:

exiftool -GPSVersionID -GPSLatitudeRef -GPSLongitudeRef -GPSAltitudeRef -GPSMapDatum -PrintIMVersion -Compression -ImageDescription -ThumbnailOffset -ThumbnailLength -XMPToolkit -CreatorTool -GPSXYAccuracy -GPSZAccuracy -HorizCS -VertCS -Roll -Pitch -Yaw FILE

- Phil

Hi Phil

I need to:

remove the line XP Comment
Add: GPS Map Datum: WGS84
Edit: Vertical CS so it states: ellipsoidal
Re-order to Roll, Pitch, Yaw from existing order
Move Vertical CS so its on the line under Horiz CS

Thanks!
Title: Re: Changing Order of Exif Data and also Description
Post by: Phil Harvey on October 02, 2022, 11:19:34 AM
My command does all of that (I think) except changing VerticalCS to "ellipsoidal".  One way to do this would be with a user-defined tag, but it may be easier to just do some post processing to do a string substitution.

- Phil
Title: Re: Changing Order of Exif Data and also Description
Post by: StarGeek on October 02, 2022, 11:31:00 AM
Phil typed quicker, but I'm posting this anyway.

Quote from: dronesurveyor on October 02, 2022, 11:04:19 AMremove the line XP Comment

Phil's command will not list this.  But you need to take note of the fact that no other tags will be listed.  From the -sort option (https://exiftool.org/exiftool_pod.html#sort---sort) docs
    Without the -sort option, tags appear in the order they were specified on the command line, or if not specified, the order they were extracted from the file.

QuoteAdd: GPS Map Datum: WGS84

Phil's command will display this if it exists, which doesn't seem to be the case in your first output listing.  If it doesn't exist, nothing will be displayed

QuoteEdit: Vertical CS so it states: ellipsoidal

This could complicate things. If all of your VertCS equal "EPSG:5773", then you could use
-api "Filter=s/^EPSG:5773$/ellipsoidal/"

but this change will affect all tags that contain "EPSG:5773".  If the number part can be variable, then you would have to either create a user defined tag as Phil says or resort to using a FMT file with -p (-printFormat) option (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat) where you could perform substitutions on that tag only.
Title: Re: Changing Order of Exif Data and also Description
Post by: dronesurveyor on October 02, 2022, 11:33:54 AM
Quote from: StarGeek on October 02, 2022, 11:31:00 AMPhil typed quicker, but I'm posting this anyway.

Quote from: dronesurveyor on October 02, 2022, 11:04:19 AMremove the line XP Comment

Phil's command will not list this.  But you need to take note of the fact that no other tags will be listed.  From the -sort option (https://exiftool.org/exiftool_pod.html#sort---sort) docs
    Without the -sort option, tags appear in the order they were specified on the command line, or if not specified, the order they were extracted from the file.

QuoteAdd: GPS Map Datum: WGS84

Phil's command will display this if it exists, which doesn't seem to be the case in your first output listing.  If it doesn't exist, nothing will be displayed

QuoteEdit: Vertical CS so it states: ellipsoidal

This could complicate things. If all of your VertCS equal "EPSG:5773", then you could use
-api "Filter=s/^EPSG:5773$/ellipsoidal/"

but this change will affect all tags that contain "EPSG:5773".  If the number part can be variable, then you would have to either create a user defined tag as Phil says or resort to using a FMT file with -p (-printFormat) option (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat) where you could perform substitutions on that tag only.


I can feel a Teamviewer session coming on!
Title: Re: Changing Order of Exif Data and also Description
Post by: dronesurveyor on October 02, 2022, 11:35:13 AM
Quote from: dronesurveyor on October 02, 2022, 11:33:54 AM
Quote from: StarGeek on October 02, 2022, 11:31:00 AMPhil typed quicker, but I'm posting this anyway.

Quote from: dronesurveyor on October 02, 2022, 11:04:19 AMremove the line XP Comment


QuoteAdd: GPS Map Datum: WGS84

I would like it added anyway as it will 'tell' the processing software how to treat it on import.
Title: Re: Changing Order of Exif Data and also Description
Post by: StarGeek on October 02, 2022, 11:39:49 AM
You can add the -f (-ForcePrint) option (https://exiftool.org/exiftool_pod.html#f--forcePrint), which will print a dash for tags that don't exist.
Title: Re: Changing Order of Exif Data and also Description
Post by: dronesurveyor on October 02, 2022, 11:55:18 AM
Quote from: StarGeek on October 02, 2022, 11:39:49 AMYou can add the -f (-ForcePrint) option (https://exiftool.org/exiftool_pod.html#f--forcePrint), which will print a dash for tags that don't exist.


So - as a test, what would be the full command line syntax for an image called 001.jpg

Thanks!
Title: Re: Changing Order of Exif Data and also Description
Post by: Phil Harvey on October 02, 2022, 12:31:44 PM
I like StarGeek's idea of using a -p print-format file.

- Phil
Title: Re: Changing Order of Exif Data and also Description
Post by: StarGeek on October 02, 2022, 05:23:24 PM
Quote from: dronesurveyor on October 02, 2022, 11:55:18 AMSo - as a test, what would be the full command line syntax for an image called 001.jpg

Use the command from Phil's post and add -f