Merge branch '8.8'
This commit is contained in:
commit
349e76bb85
@ -30,6 +30,7 @@
|
|||||||
- prevent over-pre-shrink in thumbnail [kleisauke]
|
- prevent over-pre-shrink in thumbnail [kleisauke]
|
||||||
- fix sharpen with sigma 0.5 [2h4dl]
|
- fix sharpen with sigma 0.5 [2h4dl]
|
||||||
- sharpen restores input colourspace
|
- sharpen restores input colourspace
|
||||||
|
- verify bands/format for coded images
|
||||||
|
|
||||||
24/5/19 started 8.8.1
|
24/5/19 started 8.8.1
|
||||||
- improve realpath() use on older libc
|
- improve realpath() use on older libc
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
* - use O_TMPFILE, if available
|
* - use O_TMPFILE, if available
|
||||||
* 23/7/18
|
* 23/7/18
|
||||||
* - escape ASCII control characters in XML
|
* - escape ASCII control characters in XML
|
||||||
|
* 29/8/19
|
||||||
|
* - verify bands/format for coded images
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -348,8 +350,8 @@ vips__read_header_bytes( VipsImage *im, unsigned char *from )
|
|||||||
from += 4;
|
from += 4;
|
||||||
if( im->magic != VIPS_MAGIC_INTEL &&
|
if( im->magic != VIPS_MAGIC_INTEL &&
|
||||||
im->magic != VIPS_MAGIC_SPARC ) {
|
im->magic != VIPS_MAGIC_SPARC ) {
|
||||||
vips_error( "VipsImage", _( "\"%s\" is not a VIPS image" ),
|
vips_error( "VipsImage",
|
||||||
im->filename );
|
_( "\"%s\" is not a VIPS image" ), im->filename );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,6 +400,36 @@ vips__read_header_bytes( VipsImage *im, unsigned char *from )
|
|||||||
* pixel interpretation, don't clip them.
|
* pixel interpretation, don't clip them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Coding values imply Bands and BandFmt settings --- make sure they
|
||||||
|
* are sane.
|
||||||
|
*/
|
||||||
|
switch( im->Coding ) {
|
||||||
|
case VIPS_CODING_NONE:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIPS_CODING_LABQ:
|
||||||
|
if( im->Bands != 4 ||
|
||||||
|
im->BandFmt != VIPS_FORMAT_UCHAR ) {
|
||||||
|
vips_error( "VipsImage",
|
||||||
|
"%s", _( "malformed LABQ image" ) );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIPS_CODING_RAD:
|
||||||
|
if( im->Bands != 4 ||
|
||||||
|
im->BandFmt != VIPS_FORMAT_UCHAR ) {
|
||||||
|
vips_error( "VipsImage",
|
||||||
|
"%s", _( "malformed RAD image" ) );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
g_assert_not_reached();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user