diff --git a/libvips/foreign/magick2vips.c b/libvips/foreign/magick2vips.c index 476910ce..d4f358f2 100644 --- a/libvips/foreign/magick2vips.c +++ b/libvips/foreign/magick2vips.c @@ -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", diff --git a/libvips/foreign/magick7load.c b/libvips/foreign/magick7load.c index e4b834a7..35d18864 100644 --- a/libvips/foreign/magick7load.c +++ b/libvips/foreign/magick7load.c @@ -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",