You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用exiftool移除文件夹图片元数据并保留拍摄日期?

Selectively Removing Metadata with ExifTool (Keep Shooting Date)

Absolutely, ExifTool handles this kind of targeted metadata removal perfectly—let’s walk through exactly how to set this up for your folder of images.

Core Command to Keep Shooting Date & Delete All Other Metadata

The key trick is using -all= to wipe all metadata, then explicitly excluding the date tags you want to keep with the -- prefix (this tells ExifTool to skip deleting those specific tags).

Here’s the base command for a folder (it works recursively, so it hits subfolders too):

exiftool -r -all= --DateTimeOriginal --CreateDate --ModifyDate /path/to/your/image/folder

Breakdown of Each Parameter:

  • -r: Recursively process all images in subfolders under your target directory
  • -all=: Delete every piece of metadata attached to the images
  • --DateTimeOriginal: Keep the original shooting date (this is the primary EXIF tag for when the photo was captured)
  • --CreateDate: Retain the file’s creation date (useful for maintaining consistent file timelines)
  • --ModifyDate: Preserve the file’s last modified date (optional but recommended for keeping file system consistency)

Adding Custom Exception Rules

If you ever need to keep other metadata tags down the line (e.g., camera make/model, specific GPS data), simply add more --[Tag Name] parameters. For example, to keep camera info alongside dates:

exiftool -r -all= --DateTimeOriginal --CreateDate --ModifyDate --Make --Model /path/to/your/image/folder

Target Specific Image Formats

If you only want to process certain file types (e.g., JPG, PNG, RAW), add the -ext flag for each format:

exiftool -r -ext jpg -ext png -ext cr2 -all= --DateTimeOriginal --CreateDate --ModifyDate /path/to/your/image/folder

Important Notes

  • Backups: ExifTool automatically creates backup files (e.g., photo.jpg_original) by default. Once you verify the metadata removal worked as expected, you can delete all backups with:
    exiftool -delete_original /path/to/your/image/folder
    
  • Test First: Always test the command on a single image before running it on your entire folder. For example:
    exiftool -all= --DateTimeOriginal test-image.jpg
    
    Then run exiftool test-image.jpg to confirm only the date tags remain.
  • RAW Files: Some RAW formats (like CR2, NEF) might have additional date-related tags, but DateTimeOriginal is universally supported across most image types.

内容的提问来源于stack exchange,提问作者s3voch7

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:42:13