summaryrefslogtreecommitdiff
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
parent409c42e46bc78f54d987be2f7580e4e7ae97942b (diff)
downloadefl-2a0eeba4e5fdd0de0c46000fa783cb59f7d716e7.tar.gz
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
-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
_evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
Evas_Image_Property *prop,
Evas_PNG_Info *epi,
- int *error, Eina_Bool close_file)
+ int *error, Eina_Bool is_for_data)
{
Evas_Image_Load_Opts *opts = loader->opts;
Eina_File *f = loader->f;
@@ -125,7 +125,10 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
*error = EVAS_LOAD_ERROR_NONE;
epi->hasa = 0;
- epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
+ if (!is_for_data)
+ epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
+ else
+ epi->map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
if (!epi->map)
{
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
@@ -216,7 +219,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
if (png_get_valid(epi->png_ptr, epi->info_ptr, PNG_INFO_tRNS))
{
/* expand transparency entry -> alpha channel if present */
- if (!close_file) png_set_tRNS_to_alpha(epi->png_ptr);
+ if (!is_for_data) png_set_tRNS_to_alpha(epi->png_ptr);
epi->hasa = 1;
}
@@ -245,7 +248,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
r = EINA_TRUE;
- if (!close_file) return r;
+ if (!is_for_data) return r;
close_file:
if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr,