Discussion:
WRITE BIGTIFF RGB
m***@libero.it
2014-01-20 08:46:54 UTC
Permalink
Hi,

I’m italian and excuse me for my elementary english.
I’m C++ programmer and I’m built a code to create BIGTIFF.
I use Visual Studio Express 2012.
I installed the libtiff-4.1, but I’ve some problem to setting the bigtiff over
4GB, in fact the output image done an error when I try to open:

Can you help me, please?


I report my code:

TIFF* image=NULL;
uint64 image_tiff_height=35680;
uint64 image_tiff_width=64224;
if((image = TIFFOpen(perc_output, "w8")) == NULL) {
/* printf("Could not open output.tif for writing\n");*/
return 0;
}
TIFFSetField(image, TIFFTAG_IMAGEWIDTH,image_tiff_width);
TIFFSetField(image, TIFFTAG_IMAGELENGTH,image_tiff_height);
TIFFSetField(image, TIFFTAG_BITSPERSAMPLE,8); TIFFSetField(image,
TIFFTAG_SAMPLESPERPIXEL,3);//The number of components per pixel


uint32 rowsperstrip =24;
TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); TIFFSetField(image,
TIFFTAG_COMPRESSION,COMPRESSION_JPEG);
TIFFSetField(image, TIFFTAG_JPEGQUALITY,90);


TIFFSetField(image, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);

TIFFSetField(image, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
TIFFSetField(image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);


char page_number[20];
sprintf(page_number, "Page %d", 1);

TIFFSetField(image, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE);
TIFFSetField(image, TIFFTAG_PAGENUMBER, 1, 1);
TIFFSetField(image, TIFFTAG_PAGENAME, page_number);

Best regard,
Mary


_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
h
Olivier Paquet
2014-01-20 14:18:34 UTC
Permalink
Hi,
I’m italian and excuse me for my elementary english.
I’m C++ programmer and I’m built a code to create BIGTIFF.
I use Visual Studio Express 2012.
I installed the libtiff-4.1, but I’ve some problem to setting the bigtiff
over
Can you help me, please?
Where did you get your libtiff? Try printing sizeof(uint64) to make sure it
really is 8. If you built libtiff yourself, make sure you used tif_win32.c
and not tif_unix.c. Does it work if you use no compression instead of jpeg?
Does it really break only when you reach 4GB file size, meaning it works
with a BigTIFF smaller than that?

Olivier
m***@libero.it
2014-01-20 16:03:00 UTC
Permalink
Dear Oliver,
Thanks for your interesting answer.

• Where did you get your libtiff?
o I use the libtiff from http://bigtiff.org.

• Try printing sizeof(uint64) to make sure it really is 8.
o I try to use sizeof(uint64) in this way, but it doesn’t resolve the
problem.
BYTE* buffer_strip=(BYTE *)(_TIFFmalloc((altezzatile)*image_tiff_width*sizeof
(uint64)));//ptr strip

• If you built libtiff yourself, make sure you used tif_win32.c and not
tif_unix.c.
o I’m sure to use tif_win32.c

• Does it work if you use no compression instead of jpeg?
o Yes, If I use COMPRESSION_NONE it works, but there’s the same problem: when
I open the output’s image, there is an error message: “invalid or unsupported
tif file”

• Does it really break only when you reach 4GB file size, meaning it works
with a BigTIFF smaller than that?
o Yes, It works with TIFF smaller 4GB and the output’s image is correct, but
if the uncompressed image is over 4GB I can’t open my output image.

Mary

Da: Olivier Paquet [mailto:***@gmail.com]
Inviato: lunedì 20 gennaio 2014 15:19
A: ***@libero.it
Cc: TIFF mailing list; ***@mines-paris.org
Oggetto: Re: [Tiff] WRITE BIGTIFF RGB

On Mon, Jan 20, 2014 at 3:46 AM, ***@libero.it <***@libero.it>
wrote:
Hi,

I’m italian and excuse me for my elementary english.
I’m C++ programmer and I’m built a code to create BIGTIFF.
I use Visual Studio Express 2012.
I installed the libtiff-4.1, but I’ve some problem to setting the bigtiff over
4GB, in fact the output image done an error when I try to open:

Can you help me, please?

Where did you get your libtiff? Try printing sizeof(uint64) to make sure it
really is 8. If you built libtiff yourself, make sure you used tif_win32.c and
not tif_unix.c. Does it work if you use no compression instead of jpeg? Does it
really break only when you reach 4GB file size, meaning it works with a BigTIFF
smaller than that?

Olivier


_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/lis
Joris Van Damme (AWare Systems)
2014-01-20 16:16:11 UTC
Permalink
Mary,
Post by m***@libero.it
Post by Olivier Paquet
Where did you get your libtiff?
I use the libtiff from http://bigtiff.org.
That's not official LibTiff. If you need answers specific to that
library, you'll likely need to contact the folks that distribute it.
Post by m***@libero.it
Post by Olivier Paquet
Does it work if you use no compression instead of jpeg?
Yes, If I use COMPRESSION_NONE it works, but there’s the same problem: when
I open the output’s image, there is an error message: “invalid or unsupported
tif file”
Where does that error message come from? If it's reported by some
software package different from the library you're using, it's like it
means exactly what it says. BigTIFF support in likely not very
widespread at this time.
Post by m***@libero.it
Post by Olivier Paquet
Does it really break only when you reach 4GB file size, meaning it works
with a BigTIFF smaller than that?
Yes, It works with TIFF smaller 4GB and the output’s image is correct, but
if the uncompressed image is over 4GB I can’t open my output image.
I could be mistaking, but I seem to remember that library you're using
has a quirky feature to automatically switch to BigTiff output if the
file size exceeds 4 gig. So are you sure the file smaller then 4 gig
is in fact a BigTIFF file?


Best regards,

Joris Van Damme
AWare Systems
***@awaresystems.be
http://www.awaresystems.be/
_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/

Loading...