tif_getimage.c: removed SubsamplingHor/Ver from TIFFRGBAImage structure to revert unwanted ABI change
This commit is contained in:
parent
2085534654
commit
3c78b558ae
@ -1,3 +1,8 @@
|
||||
2007-08-10 Joris Van Damme <joris.at.lebbeke@skynet.be>
|
||||
|
||||
* libtiff/tif_getimage.c: removed SubsamplingHor and SubsamplingVer
|
||||
from _TIFFRGBAImage structure to revert unwanted ABI change.
|
||||
|
||||
2007-08-10 Joris Van Damme <joris.at.lebbeke@skynet.be>
|
||||
|
||||
* libtiff/tif_win32.c: use SetFilePointer instead of
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: tif_getimage.c,v 1.67 2007-04-04 04:16:07 joris Exp $ */
|
||||
/* $Id: tif_getimage.c,v 1.68 2007-08-10 10:19:57 joris Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991-1997 Sam Leffler
|
||||
@ -431,8 +431,6 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
|
||||
photoTag, img->photometric);
|
||||
return (0);
|
||||
}
|
||||
img->SubsamplingHor = 1;
|
||||
img->SubsamplingVer = 1;
|
||||
img->Map = NULL;
|
||||
img->BWmap = NULL;
|
||||
img->PALmap = NULL;
|
||||
@ -806,17 +804,18 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
|
||||
uint32 pos;
|
||||
unsigned char* buf;
|
||||
uint32 rowsperstrip;
|
||||
uint16 subsamplinghor,subsamplingver;
|
||||
uint32 imagewidth = img->width;
|
||||
tmsize_t scanline;
|
||||
int32 fromskew, toskew;
|
||||
int ret = 1, flip;
|
||||
|
||||
buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
|
||||
buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
|
||||
if (buf == 0) {
|
||||
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
|
||||
return (0);
|
||||
}
|
||||
_TIFFmemset(buf, 0, TIFFStripSize(tif));
|
||||
_TIFFmemset(buf, 0, TIFFStripSize(tif));
|
||||
|
||||
flip = setorientation(img);
|
||||
if (flip & FLIP_VERTICALLY) {
|
||||
@ -828,15 +827,16 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
|
||||
}
|
||||
|
||||
TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
|
||||
scanline = TIFFScanlineSize(tif);
|
||||
TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
|
||||
scanline = TIFFScanlineSize(tif);
|
||||
fromskew = (w < imagewidth ? imagewidth - w : 0);
|
||||
for (row = 0; row < h; row += nrow)
|
||||
{
|
||||
rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
|
||||
nrow = (row + rowstoread > h ? h - row : rowstoread);
|
||||
nrowsub = nrow;
|
||||
if ((nrowsub%(img->SubsamplingVer))!=0)
|
||||
nrowsub+=img->SubsamplingVer-nrowsub%(img->SubsamplingVer);
|
||||
if ((nrowsub%subsamplingver)!=0)
|
||||
nrowsub+=subsamplingver-nrowsub%subsamplingver;
|
||||
if (TIFFReadEncodedStrip(tif,
|
||||
TIFFComputeStrip(tif,row+img->row_offset, 0),
|
||||
buf,
|
||||
@ -2445,8 +2445,10 @@ PickContigCase(TIFFRGBAImage* img)
|
||||
* Joris: added support for the [1,2] case, nonetheless, to accomodate
|
||||
* some OJPEG files
|
||||
*/
|
||||
TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &img->SubsamplingHor, &img->SubsamplingVer);
|
||||
switch ((img->SubsamplingHor<<4)|img->SubsamplingVer) {
|
||||
uint16 SubsamplingHor;
|
||||
uint16 SubsamplingVer;
|
||||
TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer);
|
||||
switch ((SubsamplingHor<<4)|SubsamplingVer) {
|
||||
case 0x44:
|
||||
img->put.contig = putcontig8bitYCbCr44tile;
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: tiffio.h,v 1.78 2007-07-12 13:59:34 dron Exp $ */
|
||||
/* $Id: tiffio.h,v 1.79 2007-08-10 10:19:57 joris Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
@ -201,8 +201,6 @@ struct _TIFFRGBAImage {
|
||||
int alpha; /* type of alpha data present */
|
||||
uint32 width; /* image width */
|
||||
uint32 height; /* image height */
|
||||
uint16 SubsamplingHor; /* subsampling factors */
|
||||
uint16 SubsamplingVer;
|
||||
uint16 bitspersample; /* image bits/sample */
|
||||
uint16 samplesperpixel; /* image samples/pixel */
|
||||
uint16 orientation; /* image orientation */
|
||||
|
Loading…
Reference in New Issue
Block a user