Skip to content

How to Export Photos with the Correct Shooting Time

calendar_today 2023.04.16
schedule 3 min read

When backing up old photos from years ago to iCloud, I found that the timeline of the imported photos on iCloud was wrong: it showed the import time instead of the time the photo was taken. When a photo is taken, some metadata is stored in Exif, including the shooting time. When importing into iCloud, I want photos to be displayed according to their shooting time, so that when I look at a photo, I can recall the scene in which it was taken.

Install jhead

jhead is a command-line tool that can edit image metadata.

Jhead is a command line driven program for manipulating the non-image parts of Exif flavour JPEG files that most digital cameras produce.

brew install jhead

Things jhead can extract from an Exif jpeg file

  • Time and date picture was taken
  • Camera make and model
  • Integral low-res Exif thumbnail
  • Shutter speed
  • Camera F-stop number
  • Flash used (yes/no)
  • Distance camera was focused at
  • Focal length and calculate 35 mm equivalent focal length
  • Image resolution
  • GPS info, if stored in image
  • IPTC header
  • XMP data

Things jhead can modify in an exif jpeg file

  • Up-right images according to rotation tag using jpegtran
  • Set or relative adjust internal exif timestamps
  • Fix date / time offsets in large batches of images
  • Re-name or date stamp files according to exif timestamp
  • Transfer exif headers between images
  • Replace thumbnails inside Exif headers
  • Edit jpeg comments (but not the Exif comments)
  • Delete exif or comment sections from jpeg images
  • Create new minimal exif header containing date and thumbnail

View Photo Exif Info

jhead 招生信息.jpeg

  Downloads jhead 招生信息.jpeg
File name    : 招生信息.jpeg
File size    : 5164623 bytes
File date    : 2023:03:11 16:17:36
Resolution   : 1024 x 12091
JPEG Quality : 100
Comment      : {"data":{"activityName":"","imageEffectId":"","filterId":"","product":"retouch","pictureId":"640AB745-0641-415C-94C3-9F01C11E009A","infoStickerId":"","playld":"","stickerId":"","appversion":"7.2.0","os":"ios"},"source_type":"douyin_beauty_me"}
======= IPTC data: =======

Modify Photo Time

jhead -ft xxx.jpg

// You can also modify all files in the current folder
jhead -ft *.jpg

Exif Info

Exchangeable image file format: an interchangeable image file format that records metadata of digital camera photos, including attribute information and shooting data.

TagExif Tag NameDescriptionNotes
0x010EImageDescriptionImage description
0x013BArtistArtist
0x010FMakeManufacturer
0x0110ModelModelCamera model
0x0112OrientationOrientation
0x011AXResolutionHorizontal resolution
0x011BYResolutionVertical resolution
0x0128ResolutionUnitResolution unit
0x0131SoftwareSoftwareFirmware version or editing software
0x0132DateTimeDate and timeLast modification time of the photo
0x0213YCbCrPositioningYCbCr positioning
0x8769ExifOffsetExif sub-IFD offset
0x829AExposureTimeExposure timeShutter speed
0x829DFNumberF-numberLens aperture F value
0x8822ExposureProgramExposure programAuto exposure, aperture priority, shutter priority, M mode, etc.
0x8827ISOSpeedRatingsISO speed
0x9000ExifVersionExif version
0x9003DateTimeOriginalShooting timeTime the photo was taken
0x9004DateTimeDigitizedDigitization timeTime the photo was written
0x9204ExposureBiasValueExposure compensation
0x9205MaxApertureValueMaximum aperture
0x9207MeteringModeMetering modeAverage metering, center-weighted metering, spot metering
0x9208LightsourceLight sourceUsually records white balance
0x9209FlashFlashFlash status
0x920AFocalLengthLens focal lengthPhysical focal length of the lens
0x927CMakerNoteMaker note
0x9286UserCommentUser comment
0xA000FlashPixVersionFlashPix version
ColorSpaceColor spaceAdobeRGB, sRGB, etc.
ExifImageWidthImage width
0xA003ExifImageLengthImage height
0xA433LensMakeLens manufacturer
0xA434LensModelLens model

Follow the WeChat official account Tech Backyard for more information

image.png