[fix] Allow to convert 3/5/7/9/11/13/15 bpp JP2 files to TIF

This commit is contained in:
Julien Malik 2016-03-24 17:25:46 +01:00
parent 5c5ae1d51a
commit 9399e26291
1 changed files with 6 additions and 0 deletions

View File

@ -223,6 +223,12 @@ int imagetotif(opj_image_t * image, const char *outfile)
return 1;
}
/* Store 3-bits input as 4-bits TIFF, 5-bits as 6-bits, etc... */
if ( (bps != 1) && (bps & 1) )
{
bps += 1;
}
if((bps > 16) || ((bps != 1) && (bps & 1))) bps = 0;
if(bps == 0)
{