Skip to main content
deleted 333 characters in body
Source Link
porg
  • 389
  • 2
  • 16

I) Use ImageMagick to perform the batch processing from PNG to JPG while preserving the timestamp:

mogrify -verbose -define preserve-timestamp=true -format jpg -quality 60% -path ./output/ ./input/*.png
  • preserve-timestamp correctly preserves the creation and modification timestamps in the filesystems.
  • But in the EXIF header timestamps are NOT created!
    • As I read in a forum post from 10/2018 writing EXIF metadata seems not to be in the scope of ImageMagick.
    • Hence the use of another tool:
  • As I read in a forum post from 10/2018 writing EXIF metadata seems not to be in the scope of ImageMagick.
  • Hence the use of another tool:

II) Use ExifTool to copy the creation date in the filesystem to the creation and modification date in the filesystem and into the EXIF header of the file.

exiftool "-alldates<filecreatedate" -overwrite_original_in_place -P ./output/

III) As of exiftool 12.26 on macOS 11.4 Big Sur (ca. 08/2021) the above results in a bug which I reported like this:

  • ✅ The EXIF timestamp is written correctlyoverwrite_original_in_place causes that this remains the same file, hence the creation date stays as-is.
  • ❌ But-P preserves the creation and modification timestamps intimestamp of the filesystem get set to noworiginal file which is overwritten in place.
  • So one more processing task:
    • In another tool which can copy timestamps between EXIF and the filesystem such as A Better Finder Attributes:
      • Copy EXIF timestamp to creation timestamp.
      • Copy creation to modification timestamp.
      • (Or in one pass if the software supports it.)
    And the EXIF timestamp is also updated because it's included in -alldates.

I) Use ImageMagick to perform the batch processing from PNG to JPG while preserving the timestamp:

mogrify -verbose -define preserve-timestamp=true -format jpg -quality 60% -path ./output/ ./input/*.png
  • preserve-timestamp correctly preserves the creation and modification timestamps in the filesystems.
  • But in the EXIF header timestamps are NOT created!
    • As I read in a forum post from 10/2018 writing EXIF metadata seems not to be in the scope of ImageMagick.
    • Hence the use of another tool:

II) Use ExifTool to copy the creation date in the filesystem to the creation and modification date in the filesystem and into the EXIF header of the file.

exiftool "-alldates<filecreatedate" ./output/

III) As of exiftool 12.26 on macOS 11.4 Big Sur (ca. 08/2021) the above results in a bug which I reported like this:

  • ✅ The EXIF timestamp is written correctly
  • ❌ But the creation and modification timestamps in the filesystem get set to now.
  • So one more processing task:
    • In another tool which can copy timestamps between EXIF and the filesystem such as A Better Finder Attributes:
      • Copy EXIF timestamp to creation timestamp.
      • Copy creation to modification timestamp.
      • (Or in one pass if the software supports it.)

I) Use ImageMagick to perform the batch processing from PNG to JPG while preserving the timestamp:

mogrify -verbose -define preserve-timestamp=true -format jpg -quality 60% -path ./output/ ./input/*.png
  • preserve-timestamp correctly preserves the creation and modification timestamps in the filesystems.
  • But in the EXIF header timestamps are NOT created!
  • As I read in a forum post from 10/2018 writing EXIF metadata seems not to be in the scope of ImageMagick.
  • Hence the use of another tool:

II) Use ExifTool to copy the creation date in the filesystem to the creation and modification date in the filesystem and into the EXIF header of the file.

exiftool "-alldates<filecreatedate" -overwrite_original_in_place -P ./output/
  • overwrite_original_in_place causes that this remains the same file, hence the creation date stays as-is.
  • -P preserves the modification timestamp of the original file which is overwritten in place.
  • And the EXIF timestamp is also updated because it's included in -alldates.
Source Link
porg
  • 389
  • 2
  • 16

I) Use ImageMagick to perform the batch processing from PNG to JPG while preserving the timestamp:

mogrify -verbose -define preserve-timestamp=true -format jpg -quality 60% -path ./output/ ./input/*.png
  • preserve-timestamp correctly preserves the creation and modification timestamps in the filesystems.
  • But in the EXIF header timestamps are NOT created!
    • As I read in a forum post from 10/2018 writing EXIF metadata seems not to be in the scope of ImageMagick.
    • Hence the use of another tool:

II) Use ExifTool to copy the creation date in the filesystem to the creation and modification date in the filesystem and into the EXIF header of the file.

exiftool "-alldates<filecreatedate" ./output/

III) As of exiftool 12.26 on macOS 11.4 Big Sur (ca. 08/2021) the above results in a bug which I reported like this:

  • ✅ The EXIF timestamp is written correctly
  • ❌ But the creation and modification timestamps in the filesystem get set to now.
  • So one more processing task:
    • In another tool which can copy timestamps between EXIF and the filesystem such as A Better Finder Attributes:
      • Copy EXIF timestamp to creation timestamp.
      • Copy creation to modification timestamp.
      • (Or in one pass if the software supports it.)