summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2019-08-19 08:38:44 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-08-19 16:47:22 -0700
commit2a0eeba4e5fdd0de0c46000fa783cb59f7d716e7 (patch)
treeec68965411a268b0eb98a785a05fa7a5aceda253 /src/modules
parent409c42e46bc78f54d987be2f7580e4e7ae97942b (diff)
evas: fix png regression issue
Accidentally commit "382c580 evas: add support for .9.png file to PNG loader." adding the 9 patch feature with small code refactoring missed a line calling eina_file_map_all taking EINA_FILE_SEQUENTIAL for data decoding. You can see the previous change adding the line from the following commit. e60baa0 evas: change mapping policy to be less agressive into loading file in memory. This is a response to the request of @cedric on D9580 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9614
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c11
1 files changed, 7 insertions, 4 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 1eb8b12dc8..3af01a1a2d 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 close_file) 119 int *error, Eina_Bool is_for_data)
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,7 +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 epi->map = eina_file_map_all(f, EINA_FILE_RANDOM); 128 if (!is_for_data)
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 if (!epi->map) 132 if (!epi->map)
130 { 133 {
131 *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 134 *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
@@ -216,7 +219,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
216 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))
217 { 220 {
218 /* expand transparency entry -> alpha channel if present */ 221 /* expand transparency entry -> alpha channel if present */
219 if (!close_file) png_set_tRNS_to_alpha(epi->png_ptr); 222 if (!is_for_data) png_set_tRNS_to_alpha(epi->png_ptr);
220 epi->hasa = 1; 223 epi->hasa = 1;
221 } 224 }
222 225
@@ -245,7 +248,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
245 248
246 r = EINA_TRUE; 249 r = EINA_TRUE;
247 250
248 if (!close_file) return r; 251 if (!is_for_data) return r;
249 252
250 close_file: 253 close_file:
251 if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr, 254 if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr,