fix bug in writing tiff files

This commit is contained in:
David Rose 2004-02-03 21:01:30 +00:00
parent 7032f7548e
commit f291cb741d

View File

@ -691,8 +691,11 @@ write_data(xel *array, xelval *alpha) {
// This call is a bit of fakery to convert our proper 2-d array of // This call is a bit of fakery to convert our proper 2-d array of
// xels to an indirect 2-d array of pixels. We make it look like a // xels to an indirect 2-d array of pixels. We make it look like a
// single row of _x_size * _y_size pixels. // single row of _x_size * _y_size pixels.
// We can't actually write palettes bigger than 256 colors,
// regardless of the number of colors we can read.
chv = ppm_computecolorhist( (pixel **)&array, _x_size * _y_size, 1, chv = ppm_computecolorhist( (pixel **)&array, _x_size * _y_size, 1,
TIFF_COLORMAP_MAXCOLORS, &colors ); 256, &colors );
if ( chv == (colorhist_vector) 0 ) { if ( chv == (colorhist_vector) 0 ) {
pnmimage_tiff_cat.debug() pnmimage_tiff_cat.debug()
<< colors << " colors found; too many for a palette.\n" << colors << " colors found; too many for a palette.\n"