add a sniffer for TTF
since TTF files can be caught by the almost unfixably overgenerous TGA sniffer see https://github.com/libvips/php-vips/issues/127
This commit is contained in:
parent
93ff76ce53
commit
d3f77e4433
@ -5,6 +5,7 @@
|
|||||||
- fix a crash with 0 length vectors
|
- fix a crash with 0 length vectors
|
||||||
- change default frame delay for GIFs from 1s to 0.1s
|
- change default frame delay for GIFs from 1s to 0.1s
|
||||||
- remove stray trailing comma from iiif3 dirnames [whalehub]
|
- remove stray trailing comma from iiif3 dirnames [whalehub]
|
||||||
|
- fix TTF load [chregu]
|
||||||
|
|
||||||
21/11/21 started 8.12.1
|
21/11/21 started 8.12.1
|
||||||
- fix insert [chregu]
|
- fix insert [chregu]
|
||||||
|
@ -82,6 +82,14 @@ magick_sniff( const unsigned char *bytes, size_t length )
|
|||||||
bytes[3] == 0 )
|
bytes[3] == 0 )
|
||||||
return( "ICO" );
|
return( "ICO" );
|
||||||
|
|
||||||
|
if( length >= 5 &&
|
||||||
|
bytes[0] == 0 &&
|
||||||
|
bytes[1] == 1 &&
|
||||||
|
bytes[2] == 0 &&
|
||||||
|
bytes[3] == 0 &&
|
||||||
|
bytes[4] == 0 )
|
||||||
|
return( "TTF" );
|
||||||
|
|
||||||
if( length >= 18 &&
|
if( length >= 18 &&
|
||||||
(bytes[1] == 0 ||
|
(bytes[1] == 0 ||
|
||||||
bytes[1] == 1) &&
|
bytes[1] == 1) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user