About:

 
 


Library to extract various information from the header of JPEG (Joint Photographic Experts Group) image files.

 
     

 

Download:

 
 


Download library Version 1.1

 
     

 

Properties:

 
 

FileName

Access:
Get

Description:
Returns the name of the image file the class stores the information for.
(This will be the last filename you called the ReadFile() method with.)


 
 

FileSize

Access:
Get

Description:
Returns the size of the image file the class stores the information for


 
 

Width

Access:
Get

Description:
Returns the width of the main image


 
 

Height

Access:
Get

Description:
Returns the height of the main image


 
 

BitDepth

Access:
Get

Description:
Returns the bit-depth of the main image


 
 

Precision

Access:
Get

Description:
DCT precision of the main image.
Usually either 8-bit or 12-bit


 
 

Encoding

Access:
Get

Description:
Encoding method of the main image, or "Unknown encoding method" if unknown


 
 

Terminated

Access:
Get

Description:
Specifies whether the JPEG file was properly terminated.
This is very useful since un-terminated images will often cause unsuspecting image loading routines to choke, unfortunately VB's LoadPicture() is amongst these..


 
 

Extension

Access:
Get

Description:
Extension structure and version used in this file i.e. JFIF or Exif


 
 

XDensity

Access:
Get

Description:
Horizontal resolution of the main image


 
 

YDensity

Access:
Get

Description:
Vertical resolution of the main image


 
 

Density

Access:
Get

Description:
JFIF image density (Resolution units)
Possible values are; "Pixels", "Pixels / inch" or "Pixels / cm"

 
     

 

Methods:

 
 

ReadFile()

Description:
This is the core of the class, it parses and validates the file it's passed, then exposes the information it finds through the various properties of the class.

Parameters:

Name

Description

inFile

The full path of the file to parse


Return:
True if the file was correctly parsed and validated as an JPEG image file, False if not


 
 

DensityString()

Description:
Converts a JFIF density to a readable string description

Parameters:

Name

Description

inMode

Input density mode


Return:
String containing the density name, or "Unknown" if not known.


 
 

ClearInfo()

Description:
Internal method to clear all the data currently stored in the class.


 
 

FlipWord()

Description:
Converts a big-endian Word to a little endian Word.

Parameters:

Name

Description

inWord

Word value in big-endian format to convert


Return:
Little endian conversion.


 
 

SWordToDWord()

Description:
Converts a signed Word to an unsigned Word

Parameters:

Name

Description

inWord

Signed Word value to convert


Return:
Unsigned word value stored in a DWord to prevent overflow problems.

 
     

 

User defined types:

 
 

typChunkID

Description:
Generic JPEG chunk header

Members:

Name

Description

cSig

Chunk signature (Should be 0xFF)

cType

Chunk type ID

cSize

Chunk size


 
 

typSOFInfo

Description:
JPEG Start Of Frame tag information structure

Members:

Name

Description

sofPrecision

Sample precision

sofHeight

Frame height

sofWidth

Frame width

sofComponents

Number of channels


 
 

typAPP0Info

Description:
JPEG APPlication 0 (JFIF) information structure

Members:

Name

Description

appIdentity

Signature string for APP0 segment, should be "JFIF" but could theoretically be set to other values since the APPn segments are application defined.

appNULL

Null terminator for signature string

appMajor

Major JFIF version

appMinor

Minor JFIF version

appDensity

Resolution units (See the Density property)

appXDens

Horizontal resolution measured in density units

appYDens

Vertical resolution measured in density units

appTNWidth

Thumbnail width, or 0 if not present

appTNHeight

Thumbnail height of 0 if not present


 
 

typFrameInfo

Description:
Internal structure used to store information for each frame

Members:

Name

Description

Width

Frame width

Height

Frame height

BitDepth

Frame bit-depth

Precision

Frame channel size (See the Precision property)

Encoding

Frame encoding method string

 
     

 

API:

 
 

CopyMemory