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
August 2005

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

2005.08.04 05:34 "TIFF file from RAW file", by Anil Kumar
2005.08.05 03:50 "TIFF file from RAW format", by Anil Kumar
2005.08.05 09:44 "Re: TIFF file from RAW format", by Joris Van Damme
2005.08.08 11:39 "Re: TIFF file from RAW format", by Anil Kumar
2005.08.08 11:52 "Re: TIFF file from RAW format", by Joris Van Damme

2005.08.08 11:39 "Re: TIFF file from RAW format", by Anil Kumar

Thanks for your detailed reply. I am happy to present the issue
more clearly.

I need to get the 'RAW' data from TIFF file to pass a custom made
library, so that it will return the new 'RAW' data after applying the
profile conversions. Then I need to save 'RAW' file back to TIFF file
with the original tag values, which means only RAW data of image will
change after the profile conversion. (I don't wish to change any other
things than the "RAW" data of TIFF).

Currently my application acquire the height, width etc from the TIFF
file, then save the converted 'RAW' back to TIFF using the acquired tag
values. Is my approach is correct???

//Get the height, width, colorspace & bit count
TIFFGetField(image,TIFFTAG_IMAGEWIDTH , &Width);
TIFFGetField(image,TIFFTAG_IMAGELENGTH , &Height);
TIFFGetField(image,TIFFTAG_PHOTOMETRIC , &ColorSpace);
TIFFGetField(image,TIFFTAG_BITSPERSAMPLE , &BitCount);

//Read RAW data from TIFF image
nStripSize = TIFFStripSize (image);
nStripMax = TIFFNumberOfStrips (image);
nImageOffset = 0;

nBufferSize = nStripMax * nStripSize;
g_nBufferSize = nBufferSize;

if((*pszBMPImage = (char *) malloc(nBufferSize)) == NULL)
{
      bReturnValue =  false;
}

for (nStripCount = 0; nStripCount < nStripMax; nStripCount++)
{
      if((result = TIFFReadEncodedStrip (image,
nStripCount,(*pszBMPImage) + nImageOffset,nStripSize)) == -1)
      {
              bReturnValue =  false;
      }
      nImageOffset += result;
}

////////////////////////////////////////
/////////Write RAW to TIFF
///////////////////////////////////////

TIFFSetField(image, TIFFTAG_IMAGEWIDTH, Width);
TIFFSetField(image, TIFFTAG_IMAGELENGTH, Height);
.................

nBytesWritten = TIFFWriteRawStrip(image, 0, pszBMPImage, g_nBufferSize);


Thanks
Anil