ImageIO - get image type and exif data

后端 未结 3 1750
天涯浪人
天涯浪人 2020-12-05 09:55

Given some source file (or more generic - input stream), I need to find out

  • is it an image
  • if it is an image, then retrieve its type (png/jpeg/gif/etc
3条回答
  •  清歌不尽
    2020-12-05 10:46

    It's an old thread, but I was doing this recently and found the Apache Tika library useful. Particularly for analysing generic streams to detect what content is in them.

    Thought it might help others.

    http://tika.apache.org/

提交回复
热议问题