summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-05-07 08:56:40 +0100
committerHermet Park <chuneon.park@samsung.com>2020-05-08 19:26:46 +0900
commit5f159ae624bbe4211c50e1122756c341c437656a (patch)
tree0bac09455040ac5f28031b56494ceeb41086ab57
parent882e4cd50f6c0c9d4b7c2825ba66cff42d1d476d (diff)
evas: use SEQUENTIAL for decoding png file
Summary: There was a mistake caused by "2a0eeba evas: fix png regression issue". The flag is_for_data was close_file before this commit. _evas_image_load_file_internal_head_png closes file if it is called only for header. So the close_file does not mean is_for_data. This patch is changing is_for_data to is_for_head, and make _evas_image_load_file_internal_head_png use EINA_FILE_SEQUENTIAL for data decoding. Reviewers: Hermet, jsuya, herb, raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11783
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/evas/image_loaders/png/evas_image_load_png.c b/src/modules/evas/image_loaders/png/evas_image_load_png.c
index 5b8d33f8d3..686cc2966c 100644
--- a/src/modules/evas/image_loaders/png/evas_image_load_png.c
+++ b/src/modules/evas/image_loaders/png/evas_image_load_png.c
@@ -116,7 +116,7 @@ static Eina_Bool
116_evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader, 116_evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
117 Evas_Image_Property *prop, 117 Evas_Image_Property *prop,
118 Evas_PNG_Info *epi, 118 Evas_PNG_Info *epi,
119 int *error, Eina_Bool is_for_data) 119 int *error, Eina_Bool is_for_head)
120{ 120{
121 Evas_Image_Load_Opts *opts = loader->opts; 121 Evas_Image_Load_Opts *opts = loader->opts;
122 Eina_File *f = loader->f; 122 Eina_File *f = loader->f;
@@ -125,10 +125,10 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
125 *error = EVAS_LOAD_ERROR_NONE; 125 *error = EVAS_LOAD_ERROR_NONE;
126 126
127 epi->hasa = 0; 127 epi->hasa = 0;
128 if (!is_for_data) 128 if (!is_for_head)
129 epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
130 else
131 epi->map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); 129 epi->map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
130 else
131 epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
132 if (!epi->map) 132 if (!epi->map)
133 { 133 {
134 *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 134 *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
@@ -219,7 +219,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
219 if (png_get_valid(epi->png_ptr, epi->info_ptr, PNG_INFO_tRNS)) 219 if (png_get_valid(epi->png_ptr, epi->info_ptr, PNG_INFO_tRNS))
220 { 220 {
221 /* expand transparency entry -> alpha channel if present */ 221 /* expand transparency entry -> alpha channel if present */
222 if (!is_for_data) png_set_tRNS_to_alpha(epi->png_ptr); 222 if (!is_for_head) png_set_tRNS_to_alpha(epi->png_ptr);
223 epi->hasa = 1; 223 epi->hasa = 1;
224 } 224 }
225 225
@@ -248,7 +248,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
248 248
249 r = EINA_TRUE; 249 r = EINA_TRUE;
250 250
251 if (!is_for_data) return r; 251 if (!is_for_head) return r;
252 252
253 close_file: 253 close_file:
254 if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr, 254 if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr,