test depth as well in magickload

We were testing width / height / bands when verifying that it was OK to
load a toilet-roll image ... of course we should test depth as well.
This commit is contained in:
John Cupitt 2018-04-26 13:57:33 +01:00
parent 3a9d322574
commit 9714dcdee3
2 changed files with 7 additions and 2 deletions

View File

@ -499,9 +499,13 @@ parse_header( Read *read )
read->n_pages = GetImageListLength( image );
read->n_frames = 0;
for( p = image; p; (p = GetNextImageInList( p )) ) {
int p_depth =
GetImageChannelDepth( p, AllChannels, &p->exception );
if( p->columns != (unsigned int) im->Xsize ||
p->rows != (unsigned int) im->Ysize ||
get_bands( p ) != im->Bands ) {
get_bands( p ) != im->Bands ||
p_depth != depth ) {
#ifdef DEBUG
printf( "frame %d differs\n", read->n_frames );
printf( "%zdx%zd, %d bands\n",

View File

@ -581,7 +581,8 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7,
for( p = image; p; (p = GetNextImageInList( p )) ) {
if( p->columns != (unsigned int) out->Xsize ||
p->rows != (unsigned int) out->Ysize ||
magick7_get_bands( p ) != out->Bands ) {
magick7_get_bands( p ) != out->Bands ||
p->depth != image->depth ) {
#ifdef DEBUG
printf( "frame %d differs\n", magick7->n_frames );
printf( "%zdx%zd, %d bands\n",