Help.
I'm trying to customize a ColdFusion custom tag (a specialized dll). The tag pulls binary image information from a SQLServer image field via an ODBC connection and blasts it out to the a file. This all works right now.
What I would like to know is how to get the height and width of the image so I can pass those values back. The data is being read into the variable Data of type UCHAR defined:
Just before the data is written to the file I would like to compute the height and width of the image. I assume differing types of images will have different methods of getting the dimensions. Currently the tag doesn't distinguish the image type but just blasts it out to a file. If possible I would like this to work for jpeg and png images.
I'm not sure if this is helpful but here is a snippet of the code that writes the file:
Any help is greatly appreciated!
I'm trying to customize a ColdFusion custom tag (a specialized dll). The tag pulls binary image information from a SQLServer image field via an ODBC connection and blasts it out to the a file. This all works right now.
What I would like to know is how to get the height and width of the image so I can pass those values back. The data is being read into the variable Data of type UCHAR defined:
Code:
UCHAR Data[BUFFERSIZE];
Just before the data is written to the file I would like to compute the height and width of the image. I assume differing types of images will have different methods of getting the dimensions. Currently the tag doesn't distinguish the image type but just blasts it out to a file. If possible I would like this to work for jpeg and png images.
I'm not sure if this is helpful but here is a snippet of the code that writes the file:
Code:
if (cbBinSize > (BUFFERSIZE -1))
out.Write(Data,BUFFERSIZE-1);
else
out.Write(Data,cbBinSize );
retcode = SQLGetData(hstmt1, // hstmt
1, // ipar
SQL_C_BINARY, // fCType
Data, // rgbValue
cbBatch, // cbValueMax
&cbBinSize); // pcbValue
Any help is greatly appreciated!