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

2 Answers 2


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.
  • I'm afraid this is hardly convenient
    – GJ.
    Apr 22, 2013 at 20:05
  • 2
    If you need the workflow simplified, you could put this into an Automator workflow along with an image rotation action.
    – robmathers
    Apr 22, 2013 at 20:16

for f in *.jpg; do jpegtran -rotate 90 "$f" > "$f.temp"; touch -r "$f" "$f.temp"; mv "$f.temp" "$f"; done

jpegtran is part of libjpeg. touch -r also changes the creation time if the target time is before it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .