Is there a way to infer what image format a file is, without reading the entire file?

前端 未结 4 1121
情歌与酒
情歌与酒 2021-02-20 00:19

Is there a good way to see what format an image is, without having to read the entire file into memory?

Obviously this would vary from format to format (I\'m particular

4条回答
  •  别那么骄傲
    2021-02-20 00:35

    TIFFs will begin with either II or MM (Intel byte ordering or Motorolla).
    The TIFF 6 specification can be downloaded here and isn't too hard to follow

提交回复
热议问题