Removing all metadata except dates

Started by pacman, May 13, 2016, 05:28:50 AM

Previous topic - Next topic

pacman

I'd like to remove all metadata from images except for the date tags and believe this should do the trick:

exiftool -P -overwrite_original_in_place -all= -tagsFromFile @ -DateTimeDigitized -AllDates .

But it won't remove everything except the dates, returning this error message:
Warning: [minor] Can't delete IFD0 from TIFF - ./file_tiff_Date.tiff
Warning: [minor] Can't delete IFD0 from CR2 - ./raw_canon_DATE.CR2
Warning: [minor] Can't delete IFD0 from DNG - ./raw_dng_DATE.dng
Warning: [minor] Can't delete IFD0 from ORF - ./raw_olympus_DATE.ORF
Warning: [minor] Can't delete IFD0 from TIFF - ./scan_epson_PS_DATE.tif
Warning: [minor] Can't delete IFD0 from TIFF - ./scan_tiff_02-05-16_NoDATE.tif


Is this partly because I've (prior to issuing the above command) added non-standard tags to PNG files?:

$ exiftool -r "-AllDates<MDItemContentCreationDate" "-XMP-Exif:DateTimeDigitized<MDItemContentCreationDate" -P -if 'not $exif:AllDates' -overwrite_original_in_place .
Warning: [minor] Creating non-standard EXIF in PNG - ./file_png_catyellow_NoDATE.png
Warning: [minor] Creating non-standard EXIF in PNG - ./scan_png_02-05-16_NoDATE.png
Warning: [minor] Creating non-standard EXIF in PNG - ./screensh_ff_ping_NoDATE.png
Warning: [minor] Creating non-standard EXIF in PNG - ./screensh_osx_1_NoDATE.png
Warning: [minor] Creating non-standard EXIF in PNG - ./screensh_osx_2_NoDATE.png
    1 directories scanned
    8 files failed condition
    9 image files updated


By examining the various files (exiftool -a -G1 -s FILENAME.PNG) I see that a variety of other tags are still intact as well. Why is that? Do I need to further define a whole family of tags to be removed as -all won't handle it alone?
I should probably want to keep the PNG-date tags though:

[PNG]           CreationTime 
[PNG]           CreateDate 
[PNG]           ModifyDate     

Phil Harvey

FAQ 7 talks about this.  Note that you should not delete all metadata from RAW files.  There is proprietary metadata that is required for the proper rendering of the image (I have added this to the FAQ).

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

pacman

I see. So it would be wise not to remove stuff beyond what's covered in "-all" then.
The FAQ says I can specify "-CommonIFD0=" in order to remove what "-all" doesn't with TIFF files and the following seems to remove all keywords, author names, addresses etc from files:
exiftool -P -all= -CommonIFD0= -AllDates -DateTimeDigitized -overwrite_original_in_place .

But why won't it keep the dates when I've told it so using -DateTimeDigitized and -AllDates?

StarGeek

Quote from: pacman on May 18, 2016, 10:40:08 PM
But why won't it keep the dates when I've told it so using -DateTimeDigitized and -AllDates?
You need to use double hyphen to exempt them, i.e. --DateTimeDigitized and --AllDates
"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

Phil Harvey

Again, do not apply this command to RAW files (with the possible exception of DNG).

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