use our sniffer as well is ismagick()

We need to check files for magickload with our sniffer as well as the
imagemagick one.
This commit is contained in:
John Cupitt 2019-06-08 17:13:49 +01:00
parent bb75535151
commit dc8555201d
2 changed files with 6 additions and 3 deletions

View File

@ -644,13 +644,16 @@ magick_set_magick_profile( Image *image,
/* Does a few bytes look like a file IM can handle?
*/
gboolean
magick_ismagick( const unsigned char *buf, size_t length )
magick_ismagick( const unsigned char *bytes, size_t length )
{
char format[MagickPathExtent];
magick_genesis();
return( GetImageMagick( buf, length, format ) );
/* Try with our custom sniffers first.
*/
return( magick_sniff( bytes, length ) ||
GetImageMagick( bytes, length, format ) );
}
#endif /*HAVE_MAGICK*/

View File

@ -84,6 +84,6 @@ int magick_set_vips_profile( VipsImage *im, Image *image );
int magick_set_magick_profile( Image *image,
VipsImage *im, ExceptionInfo *exception );
gboolean magick_ismagick( const unsigned char *buf, size_t length );
gboolean magick_ismagick( const unsigned char *bytes, size_t length );
#endif /*HAVE_MAGICK6*/