The list of supported image types in exiv2 is finite, and the source can be inspected to find what media type (slightly inaccurately called "mime type") they describe themselves as (for example, here's the code for GIFs).
Currently we follow Exiv2 and GExiv2's lead and just return a string.
However, is it likely that users want to know the media type in order to compare it against some known ones, and would an enum therefore be more useful?
In case the reported media type is not recognized, the MediaType enum could contain a fallback variant like "Unknown(String)" that provides the underlying raw string. Or perhaps all variants should expose their string representation too?
The list of supported image types in exiv2 is finite, and the source can be inspected to find what media type (slightly inaccurately called "mime type") they describe themselves as (for example, here's the code for GIFs).
Currently we follow Exiv2 and GExiv2's lead and just return a string.
However, is it likely that users want to know the media type in order to compare it against some known ones, and would an enum therefore be more useful?
In case the reported media type is not recognized, the
MediaType
enum could contain a fallback variant like "Unknown(String)
" that provides the underlying raw string. Or perhaps all variants should expose their string representation too?