| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
2004.06.15 05:03 "help", by Rajanikanth THi,
I tried using mfs_open() call to open memory file. but i am getting
segmentation fault at _malloc_unlocked()
can u tell me what wrong with this code?
----> start
fd = mfs_open (tiff_image,311226,"r"); /*tiff_image containes image data
of size 311226*/
tiffin = TIFFFdOpen(fd,"test" , "r"); /* test is dummy name*/
TIFFGetField(tiffin, TIFFTAG_IMAGEWIDTH, &width); /*get tif image width
*/
TIFFGetField(tiffin, TIFFTAG_IMAGELENGTH, &height); /*get tif image height
*/
npixels = width * height;
raster = (uint32*) _TIFFmalloc(npixels*sizeof(uint32));
buf = matrixCalloc (height, width);/* allocate memory */
if (raster != NULL)
{
if (TIFFReadRGBAImage(tiffin, width, height, raster, 0)) /*8 bit image*/
{
for (i=0; i<height; i++)
{
for (j=0; j<width; j++)
{
buf[(height-1)-i][j] = TIFFGetR(raster[i*width+j]);
}
}
}
}
TIFFClose(tiffin);
------>End
-----------------------------------------------
Rajanikanth T
KnS, HCL Technologies
Bangalore.
Contact No: 098860 68983
Office No : 080-51197748 Ext: 4137
http://hellorajni.8m.com
-----------------------------------------------
Disclaimer:
This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.
|
|||||||