AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.06.08 00:23 "Libtiff for embedded.", by <joe_zajac.scantron@scantron.com>
2004.06.08 06:32 "Re: Libtiff for embedded.", by Andrey Kiselev
2004.06.08 15:15 "Re: Libtiff for embedded.", by Rajanikanth T

2004.06.08 15:15 "Re: Libtiff for embedded.", by Rajanikanth T

Hi, 
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
Thanks and regards,
-----------------------------------------------
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.