public final class ImageTypeDetector extends Object
Modifier and Type | Method and Description |
---|---|
static ImageType |
detectImageType(byte[] source)
Detect image type by magic bytes given the byte array source.
|
static ImageType |
detectImageType(InputStream stream)
Detect image type by magic bytes given the input stream.
|
static ImageType |
detectImageType(URL source)
Detect image type by magic bytes given the source URL.
|
public static ImageType detectImageType(byte[] source)
source
- image bytes
ImageType
. Returns ImageType.NONE
if image type is unknown
public static ImageType detectImageType(URL source)
source
- image URL
ImageType
. Returns ImageType.NONE
if image type is unknown
public static ImageType detectImageType(InputStream stream)
stream
- image stream
ImageType
. Returns ImageType.NONE
if image type is unknown
Copyright © 1998–2022 iText Group NV. All rights reserved.