diff options
Diffstat (limited to 'libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c')
-rw-r--r-- | libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c b/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c index 9b4073c..bab169b 100644 --- a/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c +++ b/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c | |||
@@ -76,10 +76,9 @@ evas_image_load_file_head_tga(Image_Entry *ie, const char *file, const char *key | |||
76 | unsigned char *seg = NULL, *filedata; | 76 | unsigned char *seg = NULL, *filedata; |
77 | tga_header *header; | 77 | tga_header *header; |
78 | tga_footer *footer, tfooter; | 78 | tga_footer *footer, tfooter; |
79 | char hasa = 0, footer_present = 0, vinverted = 0; | 79 | char hasa = 0; |
80 | int w = 0, h = 0, bpp; | 80 | int w = 0, h = 0, bpp; |
81 | int x, y; | 81 | int x, y; |
82 | int abits; | ||
83 | 82 | ||
84 | f = eina_file_open(file, EINA_FALSE); | 83 | f = eina_file_open(file, EINA_FALSE); |
85 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 84 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
@@ -98,7 +97,7 @@ evas_image_load_file_head_tga(Image_Entry *ie, const char *file, const char *key | |||
98 | memcpy((unsigned char *)(&tfooter), | 97 | memcpy((unsigned char *)(&tfooter), |
99 | (unsigned char *)footer, | 98 | (unsigned char *)footer, |
100 | sizeof(tga_footer)); | 99 | sizeof(tga_footer)); |
101 | printf("0\n"); | 100 | //printf("0\n"); |
102 | if (!memcmp(tfooter.signature, TGA_SIGNATURE, sizeof(tfooter.signature))) | 101 | if (!memcmp(tfooter.signature, TGA_SIGNATURE, sizeof(tfooter.signature))) |
103 | { | 102 | { |
104 | if ((tfooter.dot == '.') && (tfooter.null == 0)) | 103 | if ((tfooter.dot == '.') && (tfooter.null == 0)) |
@@ -106,14 +105,12 @@ evas_image_load_file_head_tga(Image_Entry *ie, const char *file, const char *key | |||
106 | // footer is there and matches. this is a tga file - any problems now | 105 | // footer is there and matches. this is a tga file - any problems now |
107 | // are a corrupt file | 106 | // are a corrupt file |
108 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 107 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
109 | footer_present = 1; | ||
110 | } | 108 | } |
111 | } | 109 | } |
112 | // else goto close_file; | 110 | // else goto close_file; |
113 | printf("1\n"); | 111 | //printf("1\n"); |
114 | 112 | ||
115 | filedata = (unsigned char *)filedata + sizeof(tga_header); | 113 | filedata = (unsigned char *)filedata + sizeof(tga_header); |
116 | vinverted = !(header->descriptor & TGA_DESC_VERTICAL); | ||
117 | switch (header->imageType) | 114 | switch (header->imageType) |
118 | { | 115 | { |
119 | case TGA_TYPE_COLOR_RLE: | 116 | case TGA_TYPE_COLOR_RLE: |
@@ -131,7 +128,6 @@ evas_image_load_file_head_tga(Image_Entry *ie, const char *file, const char *key | |||
131 | if (!((bpp == 32) || (bpp == 24) || (bpp == 16) || (bpp == 8))) | 128 | if (!((bpp == 32) || (bpp == 24) || (bpp == 16) || (bpp == 8))) |
132 | goto close_file; | 129 | goto close_file; |
133 | if ((bpp == 32) && (header->descriptor & TGA_DESC_ABITS)) hasa = 1; | 130 | if ((bpp == 32) && (header->descriptor & TGA_DESC_ABITS)) hasa = 1; |
134 | abits = header->descriptor & TGA_DESC_ABITS; | ||
135 | // don't handle colormapped images | 131 | // don't handle colormapped images |
136 | if ((header->colorMapType) != 0) | 132 | if ((header->colorMapType) != 0) |
137 | goto close_file; | 133 | goto close_file; |