summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-02-01 18:05:16 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-02-01 18:06:43 +0000
commit9890c2b135f85fbbd3bf1ccfed90597ff65cfa71 (patch)
treebc4033cf9b2c20fadfd2789689200cf3159a4e0a /src
parent6f803ad233e397709a97a585aede4a8c3c8f0094 (diff)
evas - tga loader - ignore origin as it leads to valid tga's not loading
@fix
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/image_loaders/tga/evas_image_load_tga.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/evas/image_loaders/tga/evas_image_load_tga.c b/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
index d8ef67fc59..34ee83e0b1 100644
--- a/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
+++ b/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
@@ -77,7 +77,7 @@ evas_image_load_file_head_tga(void *loader_data,
77 tga_footer *footer, tfooter; 77 tga_footer *footer, tfooter;
78 char hasa = 0; 78 char hasa = 0;
79 int w, h, bpp; 79 int w, h, bpp;
80 int x, y; 80// int x, y;
81 Eina_Bool r = EINA_FALSE; 81 Eina_Bool r = EINA_FALSE;
82 82
83 *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; 83 *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
@@ -104,7 +104,6 @@ evas_image_load_file_head_tga(void *loader_data,
104 } 104 }
105 } 105 }
106// else goto close_file; 106// else goto close_file;
107 //printf("1\n");
108 107
109 filedata = (unsigned char *)filedata + sizeof(tga_header); 108 filedata = (unsigned char *)filedata + sizeof(tga_header);
110 switch (header->imageType) 109 switch (header->imageType)
@@ -135,13 +134,14 @@ evas_image_load_file_head_tga(void *loader_data,
135 (header->colorMapSize == 24) || 134 (header->colorMapSize == 24) ||
136 (header->colorMapSize == 32))) 135 (header->colorMapSize == 32)))
137 goto close_file; 136 goto close_file;
138 x = (header->xOriginHi << 8) | (header->xOriginLo); 137// x = (header->xOriginHi << 8) | (header->xOriginLo);
139 y = (header->yOriginHi << 8) | (header->yOriginLo); 138// y = (header->yOriginHi << 8) | (header->yOriginLo);
140 w = (header->widthHi << 8) | header->widthLo; 139 w = (header->widthHi << 8) | header->widthLo;
141 h = (header->heightHi << 8) | header->heightLo; 140 h = (header->heightHi << 8) | header->heightLo;
142 // x origin gerater that width, y origin greater than height - wrong file 141 // x origin gerater that width, y origin greater than height - wrong file
143 if ((x >= w) || (y >= h)) 142// if ((x >= w) || (y >= h))
144 goto close_file; 143// goto close_file;
144 printf("x\n");
145 // if descriptor has either of the top 2 bits set... not tga 145 // if descriptor has either of the top 2 bits set... not tga
146 if (header->descriptor & 0xc0) 146 if (header->descriptor & 0xc0)
147 goto close_file; 147 goto close_file;
@@ -237,13 +237,13 @@ evas_image_load_file_data_tga(void *loader_data,
237 (header->colorMapSize == 24) || 237 (header->colorMapSize == 24) ||
238 (header->colorMapSize == 32))) 238 (header->colorMapSize == 32)))
239 goto close_file; 239 goto close_file;
240 x = (header->xOriginHi << 8) | (header->xOriginLo); 240// x = (header->xOriginHi << 8) | (header->xOriginLo);
241 y = (header->yOriginHi << 8) | (header->yOriginLo); 241// y = (header->yOriginHi << 8) | (header->yOriginLo);
242 w = (header->widthHi << 8) | header->widthLo; 242 w = (header->widthHi << 8) | header->widthLo;
243 h = (header->heightHi << 8) | header->heightLo; 243 h = (header->heightHi << 8) | header->heightLo;
244 // x origin gerater that width, y origin greater than height - wrong file 244 // x origin gerater that width, y origin greater than height - wrong file
245 if ((x >= w) || (y >= h)) 245// if ((x >= w) || (y >= h))
246 goto close_file; 246// goto close_file;
247 // if descriptor has either of the top 2 bits set... not tga 247 // if descriptor has either of the top 2 bits set... not tga
248 if (header->descriptor & 0xc0) 248 if (header->descriptor & 0xc0)
249 goto close_file; 249 goto close_file;