FILEINFO

Summary

The FILEINFO structure, which is loaded by the LFile::GetInfo function, provides information about the specified file.

NOTE: The LTFIL.H header file describes the entire FILEINFO structure.

Members

L_INT Format

File format. For possible values, refer to Files To Be Included With Your Application.

L_TCHAR Name[_MAX_FNAME+_MAX_EXT]

A character array containing the null-terminated string that is the file name. The name is truncated if it exceeds _MAX_FNAME + _MAX_EXT characters.

L_INT Width

Image width, in pixels.

L_INT Height

Image height, in pixels.

L_INT BitsPerPixel

Bits per pixel.

L_INT32 SizeDisk

Size of the file on disk (in bytes).

L_INT32 SizeMem

Amount of memory (in bytes) required to load the file.

L_TCHAR Compression[20]

A 20-character array containing the null-terminated string that describes the compression method.

L_INT ViewPerspective

Where the beginning of the image is stored. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, and TOP_LEFT270. For descriptions, refer to Accounting for View Perspective.

L_INT Order

Color order of the bitmap. This field is meaningful if the image does not have a palette. It indicates whether the color values are in red-green-blue or blue-green-red order. Possible values are ORDER_RGB, ORDER_BGR and ORDER_GRAY.

L_INT PageNumber

The page number in a multipage file. To determine the total number of pages in a file, call LFile::GetInfo with uFlags set to FILEINFO_TOTALPAGES.

L_INT TotalPages

The total number of pages present in a file. To update this field, call LFile::GetInfo with uFlags set to FILEINFO_TOTALPAGES. If you do not want this field updated, call LFile::GetInfo with uFlags set to 0.

L_INT XResolution

Horizontal resolution, in dots per inch. Some file formats save this value in the file header.

L_INT YResolution

Vertical resolution, in dots per inch. Some file formats save this value in the file header.

L_INT32 Flags

For possible values, refer to FILEINFO Flags.

L_UINT GlobalLoop

Global animation loop count. 0 = infinity. This field is valid only if the FILEINFO_HAS_GLOBALLOOP flag is set.

L_INT GlobalWidth

Global width for animation playback

L_INT GlobalHeight

Global height for animation playback

COLORREF GlobalBackground

Global background color for animation playback (FILEINFO Flags)

RGBQUAD GlobalPalette[256]

Global palette for animation playback (FILEINFO Flags).

L_UINT32 IFD

Offset within a TIFF file where a page starts. This member is updated when LFile::GetInfo is called.

L_INT Layers

Number of layers in the file. If this value is 0, then the file does not contain any layers. Only PSD files can have layers.

L_INT ColorSpace

Color space of the file. Possible values are:

Value Meaning
COLORSPACE_BGR [0] Color space is RGB or BGR
COLORSPACE_YUV [1] Color space is YUV or YCbCr
COLORSPACE_CMYK [2] Color space is CMYK
COLORSPACE_CIELAB [3] Color space is CIELab

L_INT Channels

Number of channels in the file. If this value is 0, then the file does not contain channels. Only PSD files can have channels.

L_BOOL bIsDocFile

TRUE if the image file or stream is a document format, FALSE otherwise.

When the value of this member is TRUE, then the image file or stream passed to the L_FileInfo is a document file such as PDF or XPS and dDocPageWidth, dDocPageHeight and uDocUnit will contain the original document logical size. The physical load (rasterization size) is calculated based on the current rasterization values and is stored in Width, Height, XResolution, and YResolution.

When the value of this member is FALSE, then the image file or stream is a raster image such as JPEG or TIFF. These files have physical size and dDocPageWidth, dDocPageHeight and uDocUnit should not be used.

L_DOUBLE dDocPageWidth

The logical width of the document. This value is in uDocUnit.

The logical width and height of the document is the original size before rasterization. LEADTOOLS usually returns the logical size in inches.

dDocPageWidth should only be used if the value of bIsDocFile is TRUE.

L_DOUBLE dDocPageHeight

The logical width and height of the document is the original size before rasterization. LEADTOOLS usually returns the logical size in inches.

dDocPageHeight should only be used if the value of bIsDocFile is TRUE.

RASTERIZEDOC_UNIT uDocUnit

The unit for dDocPageWidth and dDocPageHeight. It can be one of the following values:

Value Meaning
RASTERIZEDOC_UNIT_PIXEL [0] Page width and height are in pixels.
RASTERIZEDOC_UNIT_INCH [1] Page width and height are in inches.
RASTERIZEDOC_UNIT_MILLIMETER [2] Page width and height are in millimeters.

L_INT MessageCount

Total number of messages for PST files only.

L_INT nHorzTiles

Number of horizontal tiles.

L_INT nVertTiles

Number of vertical tiles.

L_VOID *pFilterData;

Pointer to the filter data (useful for speeding up the load). See the Using Filter Data to Speed up Loading Large Files topic for more information.

L_SIZE_T uFilterDataSize;

Size of the filter data pointed by pFilterData. See the Using Filter Data to Speed up Loading Large Files topic for more information.

L_INT nFilter;

Which filter allocated the filter data. See the Using Filter Data to Speed up Loading Large Files topic for more information.

L_INT nAttachmentCount;

Number of attachments in this file if this file has any; otherwise, 0.

Comments

pFILEINFO is a pointer to a FILEINFO structure. Where the function parameter type is pFILEINFO, you can declare a FILEINFO variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pFILEINFO variable is necessary only if your program requires a pointer.

NOTES:

Do not pass an uninitialized FILEINFO to either the LFile::GetInfo or LMemoryFile::GetInfo function. If FILEINFO.Format is FILE_JPEG or FILE_TIF_JPEG and FILEINFO.BitsPerPixel is 8, then the image is 4:0:0 color space, not 4:4:4 color space.

For more information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF/BigTIFF Files.

Currently only PSD files support layers.

LEADTOOLS has attachment support for the following file formats:

Therefore, nAttachmentCount will contain a valid value only if the file is one of the formats listed above.

PDF files can be created as a portfolio, which contains multiple files assembled into an integrated unit. In these types of documents, the file contains a single generic help page with text such as "For the best experience, open this PDF portfolio in a compatible viewer", along with any number of attachments and a schema to control how to view the document. Flags will contain FILEINFO_PORTFOLIO if the file is a PDF portfolio and it is up to the application to determine how to further handle the file. See PDF Portfolio for more information.

Usage

Data Types

Functions

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.