mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
Fix crash when trying to write 16-bit TIFF file (LP bug 1222922)
Note: does not actually add support for writing 16-bit tifs; Panda just doesn't crash but automatically downsamples to 8-bit.
This commit is contained in:
parent
601b6b8678
commit
2ac1734566
@ -76,6 +76,7 @@ remained in the 1.9.1 release, including:
|
||||
* Fix constant reloading of texture when gl-ignore-mipmaps is set
|
||||
* BamReader now releases the GIL (so it can be used threaded)
|
||||
* Fix AttributeError in direct.stdpy.threading module
|
||||
* Fix crash when writing 16-bit .tif file (now silently downsamples)
|
||||
|
||||
------------------------ RELEASE 1.9.1 ------------------------
|
||||
|
||||
|
@ -1114,13 +1114,13 @@ write_data(xel *array, xelval *alpha) {
|
||||
bytesperrow = _x_size * samplesperpixel;
|
||||
} else if ( grayscale ) {
|
||||
samplesperpixel = 1;
|
||||
bitspersample = pm_maxvaltobits( _maxval );
|
||||
bitspersample = min(8, pm_maxvaltobits(_maxval));
|
||||
photometric = PHOTOMETRIC_MINISBLACK;
|
||||
i = 8 / bitspersample;
|
||||
bytesperrow = ( _x_size + i - 1 ) / i;
|
||||
} else {
|
||||
samplesperpixel = 1;
|
||||
bitspersample = 8;
|
||||
bitspersample = min(8, pm_maxvaltobits(_maxval));
|
||||
photometric = PHOTOMETRIC_PALETTE;
|
||||
bytesperrow = _x_size;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user