Class ImageTypeUtils
java.lang.Object
io.meeds.appcenter.util.ImageTypeUtils
Decides the type of an image from its first bytes, never from a name or a
label a client sent.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdetectImageMimeType(byte[] content) Decides the type of an image from its content.
-
Field Details
-
PNG_MIME_TYPE
-
JPEG_MIME_TYPE
-
GIF_MIME_TYPE
-
WEBP_MIME_TYPE
-
-
Method Details
-
detectImageMimeType
Decides the type of an image from its content.- Parameters:
content- the content of a file- Returns:
- the MIME type of a PNG, JPEG, GIF or WebP image, null for any other content, SVG included
-