AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2011.04.12 02:06 "[Tiff] Libtiff v4.0.0beta7 released", by Bob Friesenhahn
2011.04.12 13:14 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.12 13:30 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Bob Friesenhahn
2011.04.12 15:55 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.12 17:05 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Lee Howard
2011.04.12 18:01 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.13 02:30 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Graeme Gill
2011.04.13 13:08 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.15 02:36 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Graeme Gill
2011.04.15 08:41 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Igor Skochinsky
2011.04.15 13:05 "Re: [Tiff] SxS Hell, Was: Bug 1941, Was: Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.16 14:48 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Bob Friesenhahn
2011.04.18 03:47 "Re: [Tiff] Bug 1941, Was: Libtiff v4.0.0beta7 released", by Graeme Gill
2011.04.12 15:19 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.13 02:30 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Bob Friesenhahn
2011.04.13 13:09 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.13 13:44 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Bob Friesenhahn
2011.04.13 14:32 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Edward Lam
2011.04.19 16:03 "Re: [Tiff] Libtiff v4.0.0beta7 released", by Edward Lam
2011.06.01 10:43 "Re: [Tiff] Write Tile", by Jorge Martin
2011.05.31 10:54 "[Tiff] Write Tile", by Jorge Martin
2011.05.31 12:52 "Re: [Tiff] Write Tile", by Olivier Paquet
2011.05.31 13:02 "Re: [Tiff] Write Tile", by Jorge Martin
2011.05.31 13:02 "Re: [Tiff] Write Tile", by Edward Lam
2011.06.01 13:21 "Re: [Tiff] Write Tile", by Olivier Paquet
2011.04.13 15:40 "Re: [Tiff] Libtiff v4.0.0beta7 released - libtiff.def changes required", by Edward Lam
2011.04.19 19:04 "Re: [Tiff] Libtiff v4.0.0beta7 released - libtiff.def changes required", by Edward Lam
2011.04.23 09:41 "Re: [Tiff] [GM-help] PDF version", by Hunter1972

2011.06.01 10:43 "Re: [Tiff] Write Tile", by Jorge Martin

Many Thanks for you answer. I have corrected the bug and the problem disappears.

Now I have another problem writting tiles. When I open the ouput TIFF there are strange issues in all the tiles located in the left parte of the image, the rest of the image is right. I think that the problem is why the image is 3659x701 and the tiles are 128x128, so there are not an integer number of tiles, If I change the Image size in order to have a integer number of tile the problem disappears. I tried to solve this issue but I think there is something I do not solve. Please find attached the part of the code that write the tiles:

 TIFF * TIFFDst = TIFFOpen(pszDstFileName, "w");

    uint32 row_counter; // row index
    uint32 j,k; // column index
    uint32 col, row;
    uint32 TileWidth = 128;
    uint32 TileLength = 128;
    uint32 myTileWidth,  myTileLength;

    uint32 ImageWidth = m_TIFFImage.ImageTIFF_TAGs->m_Columns;
    uint32 ImageLength = m_TIFFImage.ImageTIFF_TAGs->m_Rows;
    uint8 *buffer;

    buffer = new uint8[ImageLength*ImageWidth];

  //Write the TAG info in the TIFF file
  //When the TIFF file has different planes,the TAG is the same for all of
them.
  m_TIFFImage.ImageTIFF_TAGs[0].m_TileLength = 128;
  m_TIFFImage.ImageTIFF_TAGs[0].m_TileWidth = 128;

  //Function which set all the TAGs to the output TIFF
  SetTIFFTAG(TIFFDst, 0);

  for ( row = 0; row < ImageLength; row += TileLength )
  {
      for (col = 0; col < ImageWidth; col += TileWidth )
      {

              if((ImageRows-row)<TileLength)
              {

                     myTileLength = ImageRows-row;

               }else
               {

                       myTileLength = 128;
                }

               if((ImageColumns-col)<TileWidth)
               {

                     myTileWidth= ImageColumns-col;
               }else
               {

                       myTileWidth= 128;
                }

               int index= 0;

              for (uint32 RowTile = 0; RowTile < myTileLength; RowTile++)
              {

                   for (uint32 ColTile = 0; ColTile < myTileWidth;
ColTile++)
                   {

                          buffer[index] =

(uint8)(*m_TIFFImage.m_ImagMatrix[0].Values).coeff(RowTile+row,ColTile+col);

                            index++;

                   }


               }

         TIFFWriteTile(TIFFDst, (tdata_t)buffer, col, row, 0, 0);
      }
  }

  //Free the memory to avoid memory leaks

 delete[] buffer;
 buffer = NULL;

 TIFFClose(TIFFDst);
 TIFFDst = NULL;

Best Regards

Jorge

2011/5/31 Edward Lam <edward@sidefx.com>

> Hi Jorge,
>
> On 31/05/2011 6:54 AM, Jorge Martin wrote:
> > I am trying to write a tiled TIFF file but the

> > function TIFFWriteTile is always returning "Can not write tiles to a > > stripped image" I have set the fields Tilewidth and TileLength and I do

> > not know what is happening because I did not set any field about the > > strips. How can I solve this issue? I pasted some code that I used to

> > write the TIFF:
>...

> >      //TILES INFO
> >      TIFFGetField(OutTIFF, TIFFTAG_TILEWIDTH, 128);
> >      TIFFGetField(OutTIFF, TIFFTAG_TILELENGTH,  128);

>
> Since you're writing the TIFF file, shouldn't you use TIFFSetField()

> here? This might explain why libtiff thinks you're using the stripped > interface instead of the tile interface.