Does PNG contain EXIF data like JPG?

前端 未结 6 1670
情歌与酒
情歌与酒 2020-11-27 03:18

I was wondering if PNG contains data like the following?

What I did was to convert the jpg file to png format, and I was expecting to retrieve the same info I had on

相关标签:
6条回答
  • 2020-11-27 03:28

    Edit: Version 1.5.0 (July 2017) of the Extensions to the PNG 1.2 Specification has finally added an EXIF chunk. It remains to be seen if encoders-decoders begin to support it.

    Original: PNG does not embed EXIF info. It allows, however, to embed metadata "chunks" inside the image. Some of the standardized chunks correspond to a few EXIF attributes (physical dimensions, timestamp). And it's also possible to store arbitrary textual data as key=>value pairs, or to define new chunk types. So, you could in theory store any EXIF information... but, alas, in your own custom format. Some attempts to standarize have not caught up, it seems.

    0 讨论(0)
  • 2020-11-27 03:33

    Did you mean:

    1. Do PNG files contain the metadata items you listed? Short answer: It varies.
    2. Does PNG use the EXIF standard for storing such metadata? Short answer: Generally no.

    Generally, PNG uses various chunks that are part of the PNG standard for storing metadata. To go through your list:

    • Orientation - Not applicable to PNG - fixed as row by row starting from the top left.
    • XResolution, YResolution, ResolutionUnit - pHYs chunk.
    • Software, HostComputer, other textual metadata - tEXt, iTXt, zTXt chunks.
    • DateTime - Not clear to me what this is the date/time of. tIME indicates the date/time of last modification to the image data; other dates/times can be stored in text chunks. Creation Time is actually a defined text chunk key, but the format and how time zones are handled aren't stipulated, which is a bad design.
    • ColorSpace, PixelXDimension, PixelYDimension - not sure how these would be metadata. They are fundamental to the image, and as such are in the IHDR chunk.
    • Not sure what the others you've listed mean.

    But puzzlingly, in recent years an eXIf chunk has been added to the official list of extension chunks (which is essentially an addendum to the PNG spec). Presumably it's targeted at preserving the information in files converted from JPEG/TIFF to PNG and not intended to be used in files that are created as PNGs originally, but that isn't clear.

    0 讨论(0)
  • 2020-11-27 03:36

    Yes and no.

    As other answers have already stated, PNG didn't have a formal EXIF chunk until eXIf was added in v1.5.0 (2017), and to my knowledge this chunk still does not enjoy wide support.

    But that's because it doesn't need it. Many pieces of software encode EXIF in a PNG by convention in an iTXt (or compressed zTXt) chunk notated "Raw profile type APP1". The newer eXIf chunk was intended to provide a standardised location for this, though in my opinion that ship has sailed now.

    In addition, much of the EXIF standard's metadata can be represented by XMP, an alternative and newer metadata transport mechanism that has an EXIF namespace for precisely this purpose. PNG files have included XMP documents (including translated EXIF metadata) in iTXt chunks for years. You will find that many processors convert between the two on the fly.

    0 讨论(0)
  • 2020-11-27 03:37

    Edit: As of July 2017, PNG officially supports an eXIf chunk to store EXIF metadata (specification). ExifTool 10.59 and later write EXIF to this new chunk in PNG images.

    Original: ImageMagick stores EXIF information in a PNG "Raw profile type APP1" zTXt chunk when converting from JPEG images. This method of storing EXIF in PNG images is also supported by ExifTool (and I believe Exiv2 too), but it is not part of the PNG or EXIF specification.

    0 讨论(0)
  • 2020-11-27 03:42

    As of July 2017, there does appear to be officially registered chunk for EXIF data called... eXIf:

    The data segment of the eXIf chunk contains an Exif profile in the format specified in "4.7.2 Interoperability Structure of APP1 in Compressed Data" of [CIPA DC-008-2016] except that the JPEG APP1 marker, length, and the "Exif ID code" described in 4.7.2(C), i.e., "Exif", NULL, and padding byte, are not included.

    Note that this is both A) only a few months old (as of writing) and B) an optional extension, not part of the basic specification. Therefore, support for the eXIf chunk might be limited in many applications.

    0 讨论(0)
  • 2020-11-27 03:49

    PNG does not support embedding of EXIF information. When you convert from JPEG to PNG the information is lost.

    0 讨论(0)
提交回复
热议问题