Changing Order of Exif Data and also Description

Started by dronesurveyor, October 02, 2022, 10:55:15 AM

Previous topic - Next topic

dronesurveyor

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         

Phil Harvey

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

dronesurveyor

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!

Phil Harvey

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

StarGeek

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 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 where you could perform substitutions on that tag only.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dronesurveyor

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 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 where you could perform substitutions on that tag only.


I can feel a Teamviewer session coming on!

dronesurveyor

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.

StarGeek

You can add the -f (-ForcePrint) option, which will print a dash for tags that don't exist.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dronesurveyor

Quote from: StarGeek on October 02, 2022, 11:39:49 AMYou can add the -f (-ForcePrint) option, 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!

Phil Harvey

I like StarGeek's idea of using a -p print-format 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 ($).

StarGeek

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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype