Class ImageTypeUtils

java.lang.Object
io.meeds.appcenter.util.ImageTypeUtils

public final class ImageTypeUtils extends Object
Decides the type of an image from its first bytes, never from a name or a label a client sent.
  • Field Details

  • Method Details

    • detectImageMimeType

      public static String detectImageMimeType(byte[] content)
      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