如何將iPhone中大批量的照片保留有原始創(chuàng)建時(shí)間信息的導(dǎo)入到電腦中(附帶如何批量將照片名修改為拍攝日期)

? ? 由于文件系統(tǒng)的特殊性,iPhone照片導(dǎo)入到電腦中一直是頭疼的問題,我之前就遇到了這種問題,我批量的按照順序拍攝了500+張的票據(jù),但最終我發(fā)現(xiàn)AirDrop難以如此大批量的將照片傳入我的Mac電腦,同時(shí)就算我嘗試多種方法將照片導(dǎo)入成功電腦時(shí),我發(fā)現(xiàn)它本身的創(chuàng)建日期并非照片的拍攝時(shí)間,這對(duì)我整理照片造成了非常大的困擾(因?yàn)槲蚁Mㄟ^對(duì)創(chuàng)建時(shí)間進(jìn)行排序,從而確定票據(jù)的順序及分組,并最終進(jìn)行整理)。

問題來源

? ? 但這實(shí)際上對(duì)于想正常保存好照片信息到電腦的人也造成了極大的困擾,當(dāng)你導(dǎo)出照片至電腦,某一天想整理回顧時(shí),發(fā)現(xiàn)創(chuàng)建時(shí)間完全是亂套的,給人以極大困擾,并且我發(fā)現(xiàn)在Windows電腦上同步照片時(shí),也存在該種問題:

Windows同步照片后日期錯(cuò)亂

照片導(dǎo)出后修改日期變成了導(dǎo)出日期

如何從Photos導(dǎo)出包含真確時(shí)間信息的照片

照片導(dǎo)入iphone怎么樣保留時(shí)刻信息?不會(huì)變排到今天的時(shí)間。

? ? Mac與iPhone間的傳輸則更為麻煩,我嘗試了:

(1)使用iMazing傳輸;結(jié)果失敗,導(dǎo)出無反應(yīng)

(2)AirDrop傳輸:卡在發(fā)送,取消操作后狂點(diǎn)AirDrop圖標(biāo)無反應(yīng),設(shè)置中也無法修改AirDrop的狀態(tài)

(3)iCloud圖庫;備份較慢,需要一定的云存儲(chǔ)空間支撐,非常糟糕

(4)使用數(shù)據(jù)線,對(duì)圖庫進(jìn)行同步,將手機(jī)端中的照片全部同步到了Mac中;成功?

? ? 但緊接而來的,就是如何將照片從Mac的圖庫中導(dǎo)入到電腦中存儲(chǔ):

(1)直接復(fù)制粘貼操作只會(huì)生成縮略圖:


此時(shí)創(chuàng)建日期是正確的


(2)拖拽 or 照片App-->多選后 文件-->導(dǎo)出-->導(dǎo)出x張照片:


此時(shí)命名格式為IMG_XXXX,但創(chuàng)建日期變成了導(dǎo)出時(shí)的那一刻

? ? 這可能是因?yàn)槿踔莍Phone照片導(dǎo)出的創(chuàng)建機(jī)制問題

? ? 他真正的創(chuàng)建日期和拍攝信息被儲(chǔ)存在了EXIF中:

EXIF(Exchangeable Image File format)是可交換圖像文件的縮寫,是專門為數(shù)碼相機(jī)的照片設(shè)定的,可以記錄數(shù)碼照片的屬性信息和拍攝數(shù)據(jù)。?EXIF可以附加于JPEG、TIFF、RIFF、RAW等文件之中,為其增加有關(guān)數(shù)碼相機(jī)拍攝信息的內(nèi)容和索引圖或圖像處理軟件的版本信息

? ? 所以要做的就是從EXIF信息中提取創(chuàng)建日期,然后對(duì)文件的日期信息進(jìn)行修改


以該圖舉例可以看到二者時(shí)間的異同

解決方案

? ? 這種情況下,我們選擇使用Jhead工具,Jhead是沒有圖形界面的命令行軟件,需要使用終端(Mac)or 命令提示符(Windows)運(yùn)行它并鍵入指定參數(shù)。

? ??Exif Jpeg header manipulation tool

? ? 可以看到Jhead不僅能夠提取EXIF信息,還能對(duì)其進(jìn)行修改寫入,modify主要功能有以下幾點(diǎn):

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

其中加星號(hào)的對(duì)時(shí)間戳進(jìn)行校正并批量處理就是我們所需要的,參考來源:

如何導(dǎo)出正確的照片拍攝時(shí)間-少數(shù)派


官網(wǎng)有已經(jīng)編譯好的jhead工具可直接下載

使用(傻瓜版)--最少命令行敲入

? ? 下載對(duì)應(yīng)的系統(tǒng)版本,像我選擇下載OS-X Intel可執(zhí)行版本的 jhead,將其放到你需要批量修改的照片所在的文件夾中


示例


在其他中選擇“終端”

? ? 利用cd命令載入到照片所在文件夾(可用Tab鍵補(bǔ)全 or 顯示子目錄)


我的文件在桌面,一般就是 /Users/您的用戶名/Desktop/Document

? ? 敲入ls命令,可以顯示當(dāng)前目錄下文件,確認(rèn)是否載入正確的文件夾


可見正確

jhead -ft “你的文件名”即可,例如我就是

?jhead -ft 10.jpg

###官方說明

ft????Sets the Exif timestamp to the file's timestamp. Requires an Exif header to pre-exist. Use -mkexif option to create one if needed.

這是對(duì)單一文件進(jìn)行修改,對(duì)于當(dāng)前目錄下所有文件的修改,就是用 * 符號(hào)

jhead -ft *


可見時(shí)間戳已經(jīng)恢復(fù)

長久使用——Homebrew安裝jhead? ?

Homebrew是unix優(yōu)秀的包管理工具,支持Mac/Linux,使用Homebrew能夠快速安裝jhead包,并且添加到環(huán)境變量中,無需將jhead放入要操作的目錄

(1)安裝Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

##復(fù)制到終端運(yùn)行

##由于某些原因中國大陸無法連接Github倉,可考慮垃圾撒比ggtree托管的國內(nèi)安裝源

##參見https://zhuanlan.zhihu.com/p/111014448

更多參見官網(wǎng)https://brew.sh/

(2)安裝jhead到環(huán)境變量

brew install jhead

其他

-n參數(shù)的以拍攝日期形式命名照片感覺也是個(gè)非常實(shí)用的功能

-n[<fmt-string>]

? ? This option causes files to be renamed and/or moved according to the Exif header "DateTimeOriginal" field. If the file is not an Exif file, or the DateTimeOriginal does not contain a valid value, the file date is used.

If the name includes '/' or '\' (under windows), this is interpreted as a new path for the file. If the new path does not exist, the path will be created.

If the [fmt-string] is omitted, the file will be renamed to MMDD-HHMMSS.

If a [fmt-string] is provided, the fmt-string will be passed to the strftime function for formatting. In addition, if the format string contains '%f', this will substitute the original name of the file (minus extension).

A sequence number may also be included by including '%i' in the format string. Leading zeros can be specified. '%03i' for example will pad the numbers to '001', '002'... this works just like printf in C, but with '%i' instead of '%d'.

If the target name already exists, the name will be appended with "a", "b", "c", etc, unless the name ends with a letter, in which case it will be appended with "0", "1", "2", etc.

This feature is especially useful if more than one digital camera was used to take pictures of an event. By renaming them to a scheme according to date, they will automatically appear in order of taking when viewed with some sort of viewer like Xnview or AcdSee, and sorted by name. Or you could use the -ft option and view the images sorted by date. Typically, one of the camera's date will be set not quite right, in which case you may have to use the -ta or -da options on those files first.

Some of the more useful arguments for strftime are:

%d ?Day of month as decimal number (01 – 31)

%HHour in 24-hour format (00 – 23)

%jDay of year as decimal number (001 – 366)

%mMonth as decimal number (01 – 12)

%MMinute as decimal number (00 – 59)

%SSecond as decimal number (00 – 59)

%UWeek of year as decimal number, with Sunday as first day of week (00 – 53)

%wWeekday as decimal number (0 – 6; Sunday is 0)

%yYear without century, as decimal number (00 – 99)

%YYear with century, as decimal number

Example:

jhead -n%Y%m%d-%H%M%S *.jpg

This will rename files matched by *.jpg according to YYYYMMDD-HHMMSS

Note to Windows batch file users: '%' is used to deliminate macros in Windows batch files. You must use %% to get one % passed to the program. So from a batch file, you would have to write "jhead -n%%Y%%m%%d-%%H%%M%%S *.jpg"

For a full listing of strftime arguments, look up the strftime function. Note that some arguments to the strftime function (not listed here) produce strings with characters such as '/' and ':' that may not be valid as part of a filename on various systems.

隨手測試了一下,被修改為了MMDD-TIME格式

沒有年份

? ? 后來才發(fā)現(xiàn)可以指定命名文件的日期格式,最好的還是舉例子的 %Y%m%d-%H%M%S 參數(shù)啦,精確到秒,年月日俱全


成功,異常舒適了

如何命名所有呢?自然就是

jhead -n%Y%m%d-%H%M%S *

###注意,n和后面的日期格式函數(shù)間沒有空格,-n[<fmt-string>],formate可是他的一部分哦

Windows下的使用

? ? 手頭沒有Windows電腦,cmd命令與unxi有所不同,文件目錄格式也不太一樣,可以考慮直接復(fù)制文件路徑進(jìn)CMD

ls --> dir;

cd --> cd;

使用日期命名功能,需要注意%在windows中表示宏,要改用 jhead -n%%Y%%m%%d-%%H%%M%%S

即% -->%%



發(fā)送自

我的垃圾iPhone以及Mac

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容