Read image XMP data in Python

后端 未结 6 1818
栀梦
栀梦 2020-12-09 04:20

Can I use PIL, like in this example?

I only need to read the data, and I\'m looking for the easiest simplest way to do it (I can\'t install

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 04:38

    A search through the PIL source (1.1.7) tells me that it can recognize XMP information in Tiff files, but I cannot find any evidence of a documented or undocumented API for working with XMP information using PIL at the application level.

    From the CHANGES file included in the source:

    + Support for preserving ICC profiles (by Florian Böch via Tim Hatch).
    
      Florian writes:
    
      It's a beta, so still needs some testing, but should allow you to:
      - retain embedded ICC profiles when saving from/to JPEG, PNG, TIFF.
         Existing code doesn't need to be changed.
      - access embedded profiles in JPEG, PNG, PSD, TIFF.
    
      It also includes patches for TIFF to retain IPTC, Photoshop and XMP
      metadata when saving as TIFF again, read/write TIFF resolution
      information correctly, and to correct inverted CMYK JPEG files.
    

    So the support for XMP is limited to TIFF, and only allows XMP information to be retained when a TIFF image is loaded, possibly changed, and saved. The application cannot access or create XMP data.

提交回复
热议问题