FileFormat

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.System.Enum

public final class FileFormat extends System.Enum

One of supported imaging file formats.

Fields

FieldDescription
UnknownUnknown file format.
CustomCustom file format.
BmpBmp (Dib) file format.
GifGif file format.
JpegJpeg file format.
PngPng file format.
TiffTiff file format.
PsdPsd file format.
PdfPdf file format
IcoThe ico format
Jpeg2000Jpeg2000 file format
DjvuDjvu file format
WebpThe webp file format
EmfThe Emf/Emf+ file format
DicomThe dicom format
SvgSVG file format
WmfThe Wmf file format
DngThe DNG file format
OdgThe Open document graphic format
EpsThe Encapsulated PostScript format
CdrThe CDR file format
CmxThe CMX file format
OtgThe otg file format
Html5CanvasThe Html5 Canvas format
ApngThe animated Png file format.
TgaThe Truevision TGA file format.
DxfThe AutoCAD Drawing Exchange Format.
EmzThe emz, compressed emf
WmzThe WMZ, compressed wmf
SvgzThe SVGZ, compressed svg
FOdgThe fodg, flat odg format
AvifThe AVIF file format.
BigTiffThe Big Tiff format.

Example: This example shows how to determine the image format without loading the entire image from a file.

String dir = "c:\\temp\\";

// Use an absolute path to the file
long format = com.aspose.imaging.Image.getFileFormat(dir + "sample.gif");

// A string represenation of the file format.
String strFormat;
if (format == com.aspose.imaging.FileFormat.Bmp) {
    strFormat = "BMP";
} else if (format == com.aspose.imaging.FileFormat.Gif) {
    strFormat = "GIF";
} else if (format == com.aspose.imaging.FileFormat.Dicom) {
    strFormat = "DICOM";
} else if (format == com.aspose.imaging.FileFormat.Djvu) {
    strFormat = "DJVU";
} else if (format == com.aspose.imaging.FileFormat.Dng) {
    strFormat = "DNG";
} else if (format == com.aspose.imaging.FileFormat.Png) {
    strFormat = "PNG";
} else if (format == com.aspose.imaging.FileFormat.Jpeg) {
    strFormat = "JPEG";
} else if (format == com.aspose.imaging.FileFormat.Jpeg2000) {
    strFormat = "JPEG2000";
} else if (format == com.aspose.imaging.FileFormat.Psd) {
    strFormat = "PSD";
} else if (format == com.aspose.imaging.FileFormat.Tiff) {
    strFormat = "Tiff";
} else if (format == com.aspose.imaging.FileFormat.Webp) {
    strFormat = "WEBP";
} else if (format == com.aspose.imaging.FileFormat.Cdr) {
    strFormat = "CDR";
} else if (format == com.aspose.imaging.FileFormat.Cmx) {
    strFormat = "CMX";
} else if (format == com.aspose.imaging.FileFormat.Emf) {
    strFormat = "EMF";
} else if (format == com.aspose.imaging.FileFormat.Wmf) {
    strFormat = "WMF";
} else if (format == com.aspose.imaging.FileFormat.Svg) {
    strFormat = "SVG";
} else if (format == com.aspose.imaging.FileFormat.Odg) {
    strFormat = "ODG";
} else if (format == com.aspose.imaging.FileFormat.Eps) {
    strFormat = "EPS";
} else {
    strFormat = "UNDEFINED";
}

System.out.println("The file format is " + strFormat);

Unknown

public static final long Unknown

Unknown file format.

Custom

public static final long Custom

Custom file format.

Bmp

public static final long Bmp

Bmp (Dib) file format.

Gif

public static final long Gif

Gif file format.

Jpeg

public static final long Jpeg

Jpeg file format.

Png

public static final long Png

Png file format.

Tiff

public static final long Tiff

Tiff file format.

Psd

public static final long Psd

Psd file format.

Pdf

public static final long Pdf

Pdf file format

Ico

public static final long Ico

The ico format

Jpeg2000

public static final long Jpeg2000

Jpeg2000 file format

Djvu

public static final long Djvu

Djvu file format

Webp

public static final long Webp

The webp file format

Emf

public static final long Emf

The Emf/Emf+ file format

Dicom

public static final long Dicom

The dicom format

Svg

public static final long Svg

SVG file format

Wmf

public static final long Wmf

The Wmf file format

Dng

public static final long Dng

The DNG file format

Odg

public static final long Odg

The Open document graphic format

Eps

public static final long Eps

The Encapsulated PostScript format

Cdr

public static final long Cdr

The CDR file format

Cmx

public static final long Cmx

The CMX file format

Otg

public static final long Otg

The otg file format

Html5Canvas

public static final long Html5Canvas

The Html5 Canvas format

Apng

public static final long Apng

The animated Png file format.

Tga

public static final long Tga

The Truevision TGA file format.

Dxf

public static final long Dxf

The AutoCAD Drawing Exchange Format.

Emz

public static final long Emz

The emz, compressed emf

Wmz

public static final long Wmz

The WMZ, compressed wmf

Svgz

public static final long Svgz

The SVGZ, compressed svg

FOdg

public static final long FOdg

The fodg, flat odg format

Avif

public static final long Avif

The AVIF file format.

BigTiff

public static final long BigTiff

The Big Tiff format.