This is an informational note for anyone who runs file synchronization software and also uses ExifTool.
Let's say you have a folder containing an assortment of different file types and you create another folder as a backup. Then you run exiftool commands to change the orientation of image files to horizontal and to delete any thumbnails on the first folder. You would expect the two folders to no longer be identical. However, you would not expect (or at least I did not expect) that ExifTool would slightly modify files even if it made no apparent change to a file. For example, you run commands on foobar.jpg to change the orientation to horizontal and delete thumbnails, but foobar.jpg was already oriented horizontal and already had no thumbnails. Then, you run file and folder synchronization software, the source file and destination file show a mismatch, you open both of them up in your favorite file manager, and the two files both look identical, but the software keeps telling you that they are different somehow. You look deeper and discover that the file sizes are ever so slightly off. Often it is only a fraction of a KB difference (say, 50.22 KB versus 50.12 KB). The solution is simply to run the same ExifTool commands on all the files in the backup folder.
From experience, I've discovered that when I run the orientation changing and thumbnail deleting commands on files that already had my desired characteristics, ExifTool increases the size of PNG files slightly whereas it decreases the size of JPG files slightly, with no harm done to any files. They still open and appear the exact same as they did before. I consider it a personality quirk of ExifTool rather than as a bug; ExifTool is altering the file header somehow without making any changes to the file contents.
I use Araxis Merge as my file and folder sync software (for 20+ years). The clue that files have real changes and not these phantom ExifTool changes is that if you have real changes, you will see a discrete integer in the changes column such as 2 or 5 or 17. The phantom ExifTool pseudo-changes appear as dozens of dozens of files showing an ambiguous >1 in the changes column (in other words, Araxis Merge knows something is different, but for whatever reason, can't define what is different and can't tell you how many changes there are, so it responds with "greater than one"). Once you run the ExifTool commands on the backup or destination folder and re-run Merge, the phantom changes disappear and you will see the narrowed-down list of files that have real changes.
When I import photos from my phone, I typically run ExifTool immediately. I then open the photos in FastStone Image Viewer (where I have the setting "Auto-rotate by EXIF orientation tag" unchecked) to check for any photos that are oriented wrong and losslessly rotate them using Ctrl-Alt-L or Ctrl-Alt-R. For reference, here is the batch file I use with my notes inserted at the start to remind myself of this peculiarity with ExifTool:
@echooffecho.remReminderformyself:Forsomereason,exiftoolchangesmostfilesizesslightly.remThisoccursevenifthefileisnotaJPGorJPEG,andevenifitdoesn't rotate the file or clear thumbnails.remTypically,butnotalways,PNGfilesincreaseslightlyinsize,andJPGorJPEGfilesdecreaseslightlyinsize.remIhaven't found any difference in the appearance or usability of any files after this slight change.remToensurethatAraxisMergetreatsfoldersasidentical,runthebatchfileonsourceanddestination.echoCheckingtheoriginalimagefileorientations...echoPressanykeytoproceed.pause>nulexiftool-orientation.-recho.echoCheckingforthumbnails...echoPressanykeytoproceed.pause>nulexiftool-preview:all.-recho.echoChangingallorientationstohorizontal...echoPressanykeytoproceed.pause>nulremThefollowingcommandchangestheorientationofallphotostonormalhorizontal.exiftool-orientation=1-n-m-P-r.-overwrite_original_in_placeecho.echoDeletinganythumbnails...echoPressanykeytoproceed.pause>nulremThefollowingcommandremovesallthumbnails(ifany)fromthephotos.exiftool-thumbnailimage=-m-P-r.-overwrite_original_in_placeremThe-mignoresminorerrorsorwarnings.remThe-nturnsallorientationvaluestonumbersorextractscoordinatesassigned(+or-)decimaldegrees.remThe-Ppreservesthefilemodificationdate.remThe-r(recursive)processessubfolders.remThe.(spacedotspace)processesallfilesinthecurrentfolder.rem-overwrite_original_in_placepreventscreationof.jpg_originalfiles.
Last edit: StarGeek 2026-09-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For example, you run commands on foobar.jpg to change the orientation to horizontal and delete thumbnails, but foobar.jpg was already oriented horizontal and already had no thumbnails
You are running a command that changes the Orientation and ThumbnailImage. It doesn't matter that it is changing it to the exact same thing, you are still ordering exiftool to edit the files. The file sizes change due to FAQ #13, Why is my file smaller after I use ExifTool to write information?.
If you don't want to rewrite those files, then you have to use the -if option to skip those files
I think this will work (change to single quotes if on Linux/Mac) -if "not $Orientation or $Orientation#!=1 or $ThumbnailImage"
Breakdown: not $Orientation checks to see if the Orientation tag doesn't exist.
$Orientation#!=1 checks to see if the raw value of Orientation is not equal to 1.
$ThumbnailImage checks to see if ThumbnailImage exists.
If any of these conditions are true, then exiftool will rewrite the file, writing Orientation with the raw value of 1 and removing the ThumbnailImage.
ExifTool increases the size of PNG files slightly
In this case, it's likely that exiftool is creating the EXIF block in the PNG file. PNG files rarely have EXIF data in them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looking further at your script, I didn't catch that you were running two separate exiftool commands. You can combine both of these edits into a single command so you don't have to make two passes over the files. Adding in the -if option, the result would be something like this:
exiftool -if "not $Orientation or $Orientation#!=1 or $ThumbnailImage" -thumbnailimage= -orientation=1 -n -m -P -r . -overwrite_original_in_place
Since you seem to be running the command on Windows, I would also suggest that you use -overwrite_original option instead of the -overwrite_original_in_place option. On Windows NTFS, there's no reason to use -overwrite_original_in_place unless the file has an ADS (Alternate Data Stream) attached to it. Using -overwrite_original_in_place doubles the amount of processing time, because exiftool creates the edited file, and then opens the original and copies the contents of the edited file back into the original file. With -overwrite_original, exiftool creates the edited file, deletes the original file and renames the edited file to the original name.
The main use of -overwrite_original_in_place is on a Mac file system, because Finder attributes (XAtt* and MDItem* file properties) will be lost by the -overwrite_original process.
This is an informational note for anyone who runs file synchronization software and also uses ExifTool.
Let's say you have a folder containing an assortment of different file types and you create another folder as a backup. Then you run exiftool commands to change the orientation of image files to horizontal and to delete any thumbnails on the first folder. You would expect the two folders to no longer be identical. However, you would not expect (or at least I did not expect) that ExifTool would slightly modify files even if it made no apparent change to a file. For example, you run commands on foobar.jpg to change the orientation to horizontal and delete thumbnails, but foobar.jpg was already oriented horizontal and already had no thumbnails. Then, you run file and folder synchronization software, the source file and destination file show a mismatch, you open both of them up in your favorite file manager, and the two files both look identical, but the software keeps telling you that they are different somehow. You look deeper and discover that the file sizes are ever so slightly off. Often it is only a fraction of a KB difference (say, 50.22 KB versus 50.12 KB). The solution is simply to run the same ExifTool commands on all the files in the backup folder.
From experience, I've discovered that when I run the orientation changing and thumbnail deleting commands on files that already had my desired characteristics, ExifTool increases the size of PNG files slightly whereas it decreases the size of JPG files slightly, with no harm done to any files. They still open and appear the exact same as they did before. I consider it a personality quirk of ExifTool rather than as a bug; ExifTool is altering the file header somehow without making any changes to the file contents.
I use Araxis Merge as my file and folder sync software (for 20+ years). The clue that files have real changes and not these phantom ExifTool changes is that if you have real changes, you will see a discrete integer in the changes column such as 2 or 5 or 17. The phantom ExifTool pseudo-changes appear as dozens of dozens of files showing an ambiguous >1 in the changes column (in other words, Araxis Merge knows something is different, but for whatever reason, can't define what is different and can't tell you how many changes there are, so it responds with "greater than one"). Once you run the ExifTool commands on the backup or destination folder and re-run Merge, the phantom changes disappear and you will see the narrowed-down list of files that have real changes.
When I import photos from my phone, I typically run ExifTool immediately. I then open the photos in FastStone Image Viewer (where I have the setting "Auto-rotate by EXIF orientation tag" unchecked) to check for any photos that are oriented wrong and losslessly rotate them using Ctrl-Alt-L or Ctrl-Alt-R. For reference, here is the batch file I use with my notes inserted at the start to remind myself of this peculiarity with ExifTool:
Last edit: StarGeek 2026-09-06
You are running a command that changes the
OrientationandThumbnailImage. It doesn't matter that it is changing it to the exact same thing, you are still ordering exiftool to edit the files. The file sizes change due to FAQ #13, Why is my file smaller after I use ExifTool to write information?.If you don't want to rewrite those files, then you have to use the
-ifoption to skip those filesI think this will work (change to single quotes if on Linux/Mac)
-if "not $Orientation or $Orientation#!=1 or $ThumbnailImage"Breakdown:
not $Orientationchecks to see if theOrientationtag doesn't exist.$Orientation#!=1checks to see if the raw value ofOrientationis not equal to 1.$ThumbnailImagechecks to see ifThumbnailImageexists.If any of these conditions are true, then exiftool will rewrite the file, writing
Orientationwith the raw value of 1 and removing theThumbnailImage.In this case, it's likely that exiftool is creating the EXIF block in the PNG file. PNG files rarely have EXIF data in them.
Looking further at your script, I didn't catch that you were running two separate exiftool commands. You can combine both of these edits into a single command so you don't have to make two passes over the files. Adding in the
-ifoption, the result would be something like this:exiftool -if "not $Orientation or $Orientation#!=1 or $ThumbnailImage" -thumbnailimage= -orientation=1 -n -m -P -r . -overwrite_original_in_placeSince you seem to be running the command on Windows, I would also suggest that you use
-overwrite_originaloption instead of the-overwrite_original_in_placeoption. On Windows NTFS, there's no reason to use-overwrite_original_in_placeunless the file has an ADS (Alternate Data Stream) attached to it. Using-overwrite_original_in_placedoubles the amount of processing time, because exiftool creates the edited file, and then opens the original and copies the contents of the edited file back into the original file. With-overwrite_original, exiftool creates the edited file, deletes the original file and renames the edited file to the original name.The main use of
-overwrite_original_in_placeis on a Mac file system, because Finder attributes (XAtt*andMDItem*file properties) will be lost by the-overwrite_originalprocess.See also FAQ #31, "Why does ExifTool rewrite the entire file when I am only changing one small thing?".