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
September 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.09.19 02:47 "How can I remove the last white lines?", by Flávio Tiba
2005.09.19 06:32 "Re: How can I remove the last white lines?", by Joris Van Damme
2005.09.19 06:35 "Re: How can I remove the last white lines?", by Joris Van Damme

2005.09.19 02:47 "How can I remove the last white lines?", by Flávio Tiba

Hello, 

I am a new user of libtiff library and I have some doubts. I am developing a
program to read a tiff file G3 and I need to clear the last white lines from
file, I would like to know what api can I use? 

my code: 

 TIFF *image;  
 tsize_t stripSize;  
 unsigned long imageOffset,result;  
 int stripMax,stripCount;
 char *buffer;
 unsigned long bufferSize;
 uint32 rowsperstrip;
 int count;
 uint32 width;
 
 // Abre a imagem TIFF.
 if((image = TIFFOpen(pathArquivo, "r")) == NULL)
 {    
  fprintf(stderr, "Could not open incoming image\n");   
  return FALSE;
 }
 
 // L a possibilidade de multiplos strips.
 if((stripSize = TIFFStripSize (image)) == -1)
 {
  return FALSE;
 } 
 if((stripMax = TIFFNumberOfStrips (image)) == -1)
 {
  return FALSE;
 }
 bufferSize = TIFFNumberOfStrips (image) * stripSize;
 
 if((buffer = (char *) malloc(bufferSize)) == NULL)
 {   
  fprintf(stderr, "Could not allocate enough memory for the uncompressed
  image\n");    
  return FALSE;
 }   
 
 imageOffset = 0;
 for (stripCount = 0; stripCount < stripMax; stripCount++)
 {   
  if((result = TIFFReadEncodedStrip (image, stripCount, buffer +
  imageOffset,stripSize)) == -1)
  {     
    fprintf(stderr, "Read error on input strip number %d\n", stripCount);   
     
    return FALSE;
  }    
  imageOffset += result; 
 }