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 2010

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

2010.08.20 08:16 "TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.22 02:26 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by Scott Ribe
2010.08.23 07:04 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.23 07:40 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <jcupitt@gmail.com>
2010.08.23 08:04 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.23 08:18 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.23 10:47 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <jcupitt@gmail.com>
2010.08.23 10:18 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.23 12:02 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by Juergen Buchmueller
2010.08.23 13:25 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.23 14:17 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>
2010.08.23 14:38 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by Olivier Paquet
2010.08.24 12:31 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <molholm@gmail.com>

2010.08.23 10:47 "Re: TIFFWriteScanline works on Windows and Linux but fails on Mac", by <jcupitt@gmail.com>

As I said, it sounds like a configure problem to me. Where did you get
the libtiff binary? Did you build it yourself? Check the output of
configure for errors.

libtiff works fine for me on Mac, if that's any comfort.

John

2010/8/23 Dennis Mølhom Hansen <molholm@gmail.com>:
> Update: any compression seems to fail on mac, only uncompressed work.
> Any ideas where to look for a cause/solution?
>
> 2010/8/23 Dennis Mølhom Hansen <molholm@gmail.com>:
>> I have narrowed down my problem a bit, first I found that the
>> following is needed on Mac:
>>
>> TIFFSetField(tiffImage, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
>>
>> Even though the tif spec. clearly stats that: "If SamplesPerPixel is
>> 1, PlanarConfiguration is irrelevant, and need not be included."
>>
>> Futhermore, i'm now able to save my image correct if I do not use
>> compression. But I needed LWZ compression, any ideas why
>> TIFFSetField(tiffImage, TIFFTAG_COMPRESSION, COMPRESSION_LZW); make
>> TIFFWriteScanline fail?
>>
>> 2010/8/20 Dennis Mølhom Hansen <molholm@gmail.com>:
>>> I use libtiff3.9.4 for reading and writing TIFF files in c++ on mac
>>> 10.6.4. My project is written to be portable and runs without any
>>> issues on both Windows 32-bit og Ubuntu 64-bit. But on the mac the
>>> Libtiff function TIFFWriteScanline always fails (it returns != 1). The
>>> TIFF file is created, but it does not have any contents. I'am able to
>>> read the LZW compressed images but i'm not able to write it.
>>> Furthermore the program also works for CCITT Group4 images on windows
>>> and linux, but read scanline fails on the mac.
>>>
>>> I have tried both libtiff3.8.2 and libtiff4.0.0beta6 without any luck.
>>>
>>> Any ideas why libtiff won't write scanlines on the mac when it works
>>> fine on linux?
>>>
>>> Code:
>>>
>>> // set baseline tags
>>> TIFFSetField(tiffImage, TIFFTAG_IMAGEWIDTH, 7368);
>>> TIFFSetField(tiffImage, TIFFTAG_IMAGELENGTH, 4757);
>>> TIFFSetField(tiffImage, TIFFTAG_BITSPERSAMPLE, 8);
>>> TIFFSetField(tiffImage, TIFFTAG_SAMPLESPERPIXEL, 1);
>>> TIFFSetField(tiffImage, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
>>> TIFFSetField(tiffImage, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
>>> TIFFSetField(tiffImage, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
>>> TIFFSetField(tiffImage, TIFFTAG_THRESHHOLDING, 1);
>>> TIFFSetField(tiffImage, TIFFTAG_XRESOLUTION, 400;
>>> TIFFSetField(tiffImage, TIFFTAG_YRESOLUTION, 400);
>>> TIFFSetField(tiffImage, TIFFTAG_RESOLUTIONUNIT, 2);
>>>
>>> uint32  rowsPerStrip;
>>> rowsPerStrip = tiffData->height;
>>> rowsPerStrip = TIFFDefaultStripSize(tiffImage, rowsPerStrip);
>>> TIFFSetField(tiffImage, TIFFTAG_ROWSPERSTRIP, rowsPerStrip);
>>> TIFFSetupStrips(tiffImage);
>>>
>>> // row buffer
>>> scanlineSize = TIFFScanlineSize(tiffImage);
>>> scanline = (unsigned char*) _TIFFmalloc(scanlineSize);
>>>
>>> // write image
>>> for (int i = 0; i < iplImage->height; i++)
>>> {
>>>   memcpy(scanline, iplImage->imageData + iplImage->widthStep*i, scanlineSize);
>>>   if(TIFFWriteScanline(tiffImage, scanline, i, 0) != 1){
>>>      //Error
>>>   }
>>> }
>>>
>>> // clean up
>>> _TIFFfree(scanline);
>>>
>>> Regards,
>>> Dennis
>>>
>>
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/
>