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.
| Tag | Exif Tag Name | Description | Notes |
|---|---|---|---|
| 0x010E | ImageDescription | Image description | |
| 0x013B | Artist | Artist | |
| 0x010F | Make | Manufacturer | |
| 0x0110 | Model | Model | Camera model |
| 0x0112 | Orientation | Orientation | |
| 0x011A | XResolution | Horizontal resolution | |
| 0x011B | YResolution | Vertical resolution | |
| 0x0128 | ResolutionUnit | Resolution unit | |
| 0x0131 | Software | Software | Firmware version or editing software |
| 0x0132 | DateTime | Date and time | Last modification time of the photo |
| 0x0213 | YCbCrPositioning | YCbCr positioning | |
| 0x8769 | ExifOffset | Exif sub-IFD offset | |
| 0x829A | ExposureTime | Exposure time | Shutter speed |
| 0x829D | FNumber | F-number | Lens aperture F value |
| 0x8822 | ExposureProgram | Exposure program | Auto exposure, aperture priority, shutter priority, M mode, etc. |
| 0x8827 | ISOSpeedRatings | ISO speed | |
| 0x9000 | ExifVersion | Exif version | |
| 0x9003 | DateTimeOriginal | Shooting time | Time the photo was taken |
| 0x9004 | DateTimeDigitized | Digitization time | Time the photo was written |
| 0x9204 | ExposureBiasValue | Exposure compensation | |
| 0x9205 | MaxApertureValue | Maximum aperture | |
| 0x9207 | MeteringMode | Metering mode | Average metering, center-weighted metering, spot metering |
| 0x9208 | Lightsource | Light source | Usually records white balance |
| 0x9209 | Flash | Flash | Flash status |
| 0x920A | FocalLength | Lens focal length | Physical focal length of the lens |
| 0x927C | MakerNote | Maker note | |
| 0x9286 | UserComment | User comment | |
| 0xA000 | FlashPixVersion | FlashPix version | |
| ColorSpace | Color space | AdobeRGB, sRGB, etc. | |
| ExifImageWidth | Image width | ||
| 0xA003 | ExifImageLength | Image height | |
| 0xA433 | LensMake | Lens manufacturer | |
| 0xA434 | LensModel | Lens model |
Follow the WeChat official account Tech Backyard for more information
