How to losslessly rotate rotate jpeg images *without* a change to the last modified date

image editing

I'm looking for some convenient tool to handle such rotation without changing the file timestamps.

Best Answer

I'm not aware of any image tools that have this functionality built in, but you can use the built-in UNIX touch command to adjust the timestamps.

  1. In Terminal, run touch -r photo.jpeg timestamp. That will create an empty file named timestamp with the timestamp of your image (replace photo.jpeg with the path to your file).
  2. Edit your file however you want.
  3. In Terminal, run touch -r timestamp photo.jpeg. That will copy the timestamp from the timestamp file back to your image file.
  4. Remove the timestamp file: rm timestamp.