Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Sunshow Pro V3.0 - <b>jpeginfo()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
JPEGInfo()

Reads a JPEG file header and returns image information


Syntax

JPEGInfo(<cFILE.JPG>, @<nLeft>, @<nTop>, @<nWidth>, 
   @<nHeight>, @<nNumChannels>)


Arguments

<cFILE.JPG>
Name of the JPEG image file, and optional drive and path.

<nLeft>
Horizontal starting left coordinate of the image.

<nTop>
Vertical starting top coordinate of the image.

<nWidth>
Horizontal width of the image.

<nHeight>
Vertical height of the image.

<nNumChannels>
Number of color channels contained in the image.


Returns

0
Success. If successful, function returns <nLeft>, 
<nTop>, <nWidth>, <nHeight>, and <nNumChannels> 
from the image file.

-1
Cannot open <cFILE.JPG>.

-2
This is not an JPEG image file.

-99
Parameters are invalid.


Remarks

JPEGInfo() reads the header of an JPEG image file and returns information 
about <cFILE.JPG>. <nLeft>, <nTop>, <nWidth>, <nHeight>, and <nNumChannels> 
must be initialized before-hand and passed by reference by prefacing the 
variable with the pass-by-reference operator (@). The number of color 
channels in a JPEG image will be three (YUV or YIQ color space models) for 
color images or one (Y - Intensity) for a monochrome image.


Example

nLeft = 0
nTop = 0
nWidth = 0
nHeight = 0
nNumChannels = 0
cFileName = "FILE.JPG"
nStatus = JPEGInfo(cFileName, @nLeft, @nTop, @nWidth, ;
   @nHeight, @nNumChannels)
IF nStatus < 0
     DO CASE
    CASE nStatus = -1
        ? "Cannot open ", cFileName
    CASE nStatus = -2
        ? cFileName, " is not a JPEG file"
    CASE nStatus = -99
        ? "Parameters are invalid"
     ENDCASE
     RETURN
ENDIF



Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson