Search code examples
pngjpegphotos

Can I get some general info about image file like .png . jpg?


Can I and how I can based on this link get some general of this photo like size in px, size in mb ... and maybe some more info ?


Solution

  • You would need to write something that:

    1. identifies the type of the image stream using the file signature.
    2. Reads the header information for each stream type
    3. Prints the information out.

    You would need to examine the stream format specifications for each type you are interested in. For JPEG, you are probably interested in the SOS marker and maybe the various APPn markers used by different file formats.