2017-11-06 10 views
0

.jpeg, .tif, .psd, .pdf 등의 형식으로 50,000 개 이상의 이미지에 대한 메타 데이터가 있습니다. 이미지의 메타 데이터를 IPTC에 포함하려고합니다. GraphicsMagick.NET을 사용하는 필드. 이미지에 IPTC 프로파일을 추가하고 이미지를 저장하면 작동하는 것처럼 보입니다. GraphicsMagick은 방금 이미지 용으로 저장 한 IPTC 프로파일을 검색 할 수 있습니다.GraphicsMagick.NET을 사용하여 IPTC 필드 편집

그러나 이미지의 속성을 볼 때 변경 사항을 볼 수 없습니다.

내가 잘못 했습니까? GraphicsMagick은 표준 IPTC 필드에 쓰지 않습니까? 이 GraphicsMagick 실제로 이미지에 XMP 필드에 기록 된 것으로 보인다, 많은 추가 연구 후

class Program 
{ 
    static void Main(string[] args) 
    { 
     EmbedIptcMetaData(); 
    } 

    private static void EmbedIptcMetaData() 
    { 
     // Picture of a cake found here: https://static.pexels.com/photos/353347/pexels-photo-353347.jpeg 
     // Labeled for reuse with modification 
     // Saved to desktop 
     string desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop); 
     string originalFilePath = System.IO.Path.Combine(desktopPath, "pexels-photo-353347.jpeg"); 
     string modifiedFilePath = System.IO.Path.Combine(desktopPath, "pexels-photo-353347-modified.jpeg"); 

     // NuGet package: GraphicsMagick.NET-Q8-AnyCPU 
     using (GraphicsMagick.MagickImage image = new GraphicsMagick.MagickImage(originalFilePath)) 
     { 
      // Read the initial IPTC profile of the image 
      GraphicsMagick.IptcProfile initialProfile = image.GetIptcProfile(); // initialProfile has the image author, Ana Paula Silva 

      // Create a new IPTC profile 
      GraphicsMagick.IptcProfile newProfile = new GraphicsMagick.IptcProfile(); 
      newProfile.SetValue(GraphicsMagick.IptcTag.Keyword, "cake,wedding,photography"); 

      // Add the new IPTC profile 
      image.AddProfile(newProfile); 

      // Save the image 
      image.Write(modifiedFilePath); // I expect the IPTC profile to now only have a value for the caption field 
     } 

     using (GraphicsMagick.MagickImage modifiedImage = new GraphicsMagick.MagickImage(modifiedFilePath)) 
     { 
      // Read the modified image's IPTC profile 
      GraphicsMagick.IptcProfile profile = modifiedImage.GetIptcProfile(); // profile == newProfile from above 
     } 
    } 
} 

Image properties without keywords saved

답변

0

:

은 여기 내 문제를 설명하는 간단한 콘솔 응용 프로그램입니다. 문서가 희박하고 0 이외의 다른 인덱스에 키워드를 쓰는 방법을 찾을 수 없었습니다.

결국 Atalasoft DotImage를 사용하여 전환했습니다.