mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 12:00:45 +00:00
use a constant for signature and use for now only the bytes needed for TGA
This commit is contained in:
parent
7feeccceab
commit
3ec731943c
1 changed files with 4 additions and 2 deletions
|
@ -125,6 +125,8 @@
|
|||
return bmp;
|
||||
}
|
||||
|
||||
#define SIGNATURE_LENGTH 18
|
||||
|
||||
+ (NSArray*) imageRepsWithData: (NSData *)data allImages: (BOOL)allImages
|
||||
{
|
||||
NSMutableArray *reps = [NSMutableArray array];
|
||||
|
@ -133,7 +135,7 @@
|
|||
ImageInfo *imageinfo = CloneImageInfo(NULL);
|
||||
Image *images;
|
||||
Image *image;
|
||||
char signature[32];
|
||||
char signature[SIGNATURE_LENGTH];
|
||||
|
||||
// Set the background color to transparent
|
||||
// (otherwise SVG's are rendered against a white background by default)
|
||||
|
@ -143,7 +145,7 @@
|
|||
QueryColorDatabase("none", &imageinfo->background_color, exception);
|
||||
#endif
|
||||
|
||||
memset(signature, 0, 32);
|
||||
memset(signature, 0, SIGNATURE_LENGTH);
|
||||
[data getBytes: signature range: NSMakeRange([data length] - 18, 18)];
|
||||
if (strncmp(signature, "TRUEVISION-XFILE.", 17) == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue