2016-10-09 26 views
2

這與Extract IPTC-Keywords Longer than 64 Chars in Java密切相關。請在那裏看到我的意見。無法從JPEG元數據中檢索標題的全文

問題在於,在描述選項卡(在Windows文件屬性對話框的「詳細信息」選項卡中也顯示爲「標題」)中,Adobe Bridge中的JPEG文件添加爲「文檔標題」的標題最終在兩個位置在JPEG文件中,可以在文件的十六進制顯示中看到。一個有完整的標題,一個只有64個字符。

我可以通過檢索所有元數據目錄中的所有標記描述來獲取被截斷的一個(標記名稱「Object Name」),但是我無法獲得完整的標題。

下面是一個例子文件,其嵌入的標題是「清晨威爾哈伊海灘俱樂部和坡伊普灣公園之間的吐」:

sample file with metadata

+1

提到的相關問題是http://stackoverflow.com/q/38399216/24874 –

+0

您的非答案中的十六進制轉儲是否與此問題相關?那麼請在這裏添加它們,所以這個問題是獨立的。如果您無法嵌入圖像,請不要擔心 - 可以肯定會爲您提供圖像的人。 – usr2564301

回答

1

我很樂意看看這個爲你。但imgur已從該文件中刪除了元數據。

你可以在GitHub項目上打開一個問題嗎?任何附加的圖像也不會有元數據刪除:

https://github.com/drewnoakes/metadata-extractor/issues/new

請還提到你是否授予使用圖像中的項目的迴歸測試數據集的權限。


我可以從你的其他後看到的是,你引用更長的形式是:

該字符串中的XMP數據(由周圍的RDF XML作爲證明)。你可以用類似的代碼訪問它:

// Extract metadata from the image 
Metadata metadata = ImageMetadataReader.readMetadata(image); 

// Iterate through any XMP directories we may have received 
for (XmpDirectory xmpDirectory : metadata.getDirectoriesOfType(XmpDirectory.class)) { 

    // Usually with metadata-extractor, you iterate a directory's tags. However XMP has 
    // a complex structure with many potentially unknown properties. This doesn't map 
    // well to metadata-extractor's directory-and-tag model. 
    // 
    // If you need to use XMP data, access the XMPMeta object directly. 
    XMPMeta xmpMeta = xmpDirectory.getXMPMeta(); 

    // Iterate XMP properties 
    XMPIterator itr = xmpMeta.iterator(); 
    while (itr.hasNext()) { 
     XMPPropertyInfo property = (XMPPropertyInfo) itr.next(); 

     // Print details of the property 
     System.out.println(property.getPath() + ": " + property.getValue()); 
    } 
} 

我還是想看到一個樣本圖像,但是從十六進制編輯器在看到你的截圖,我懷疑Adobe Bridge中被截斷的字符串64個字節IPTC。在線快速搜索表明這是IPTC關鍵字字段的最大長度。

+0

XMP目錄是我需要的。標題全文位於路徑爲「dc:title [1]」的屬性中。謝謝。我將把圖片上傳到GitHub。 – Photomungus