Does PNG contain EXIF data like JPG?

前端 未结 6 1706
情歌与酒
情歌与酒 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: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.

提交回复
热议问题