檢視文章

關於ExifTool 9.99〜10.06無法正常傳回EXIF資訊的問題點

insoler目前相片模組的「EXIF資訊」並不是使用PHP內建的exif_read_data指令,因為exif_read_data太過簡陋,只能讀取最基本的相片資訊,無法讀出各相機品牌最重要的EXIF資訊!因此我是利用另外一個更好用的ExifTool來讀取各相機品牌的EXIF資訊。

雖然ExifTool相當好用,但終究還是出了問題!自從他們升級版本到ExifTool 9.99以後,以及今天才剛剛釋出的最新版本ExifTool 10.06,都無法正常使用!

有很多事情很難用文字說明清楚,還是來看一下視窗畫面,會比較簡單明瞭。

我重新安裝了舊版的ExifTool 9.98。只有這個版本才能正常使用,但是ExifTool 9.99〜10.06之間,解決了哪些bug,或是支援了哪些新的相機型號,這個我就不知道了。原本只要能正常使用,根本不需要知道ExifTool每個版本之間的差異。

為了避免爭議,我使用的是「ExifTool -h」在「-php」這個部分建議的程式碼。

-php

Format output as a PHP Array. The -g-G-D-H-l,-sep and -struct options combine with -php, and duplicate tags arehandled in the same way as with the -json option. As well, the -boption may be added to output binary data. Here is a simple example showinghow this could be used in a PHP script:

<?php

    eval('$array=' . `exiftool -php -q image.jpg`);

    print_r($array);

?>

這段程式碼也是ExifTool他們自己寫出來的示範程式:

Topic: PHP version of ExifTool libraries  (Read 15956 times)

你可以看到ExifTool 9.98與PHP程式可以正常運作,可以在瀏覽器裡面顯示出傳回給PHP的$array的陣列變數內容:

exiftool001.jpg

完全不修改任何的PHP程式碼,只有安裝今天才剛剛釋出的ExifTool 10.06,然後重新載入Safari的瀏覽器網頁畫面,就只會看到一片空白的畫面!

exiftool002.jpg

這表示ExifTool 10.06完全無法正常使用!沒有任何資料傳回到$array陣列變數裡面!事實上也只有ExifTool 9.98可以正常執行,就連小改版的ExifTool 9.99都不行!同樣只會看到一片空白的畫面!

如果PHP程式有問題,那麼應該是連ExifTool 9.98都無法正常執行才對。所以問題不是出在他們寫的「標準示範PHP程式」!

那麼,是ExifTool 10.06與作業系統OS X 10.10.5不相容?不是!因為另外一台更老舊的OS X 10.8.5 2.6GHz Intel Core i7,也是得到相同的結果。

我不可能解決ExifTool 10.06的問題,唯一的解決辦法就是重新安裝ExifTool 9.98,不要升級。但不可能永遠都不升級,所以什麼時候能解決這個問題?我也不知道。但很顯然,目前只有我遇到這個問題,連ExifTool的「Phil Harvey」也沒遇到任何問題。因為他說...

I'm afraid you have to be more specific.

This works fine for me using ExifTool 10.06 on all of the images in the t/images directory of the full distribution.  What is the output of "exiftool -php image.jpg" for your image?

蘇言霖 2015/11/27 0 1109
評論
排序依據: 
每頁:
 
  • 目前還沒有評論
評分
0
文章資訊
蘇言霖
「超級懶貓級」社群網站站長
2015/11/27 (3067天前)
動作