summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-05-19 11:57:55 +0900
committerHermet Park <chuneon.park@samsung.com>2020-05-19 11:57:56 +0900
commit9c0484c9cb5bc9d9569a31d8e49f4fff31b0b472 (patch)
tree61dd8fc4807bab7efa431d5f10d0951a98fc5cdd
parent93cddac02df13275e19c43fa52d8eebe32b9aab8 (diff)
png: handle file name .9.png
Summary: .9.png is not 9 patch file, but a png file which name is .9 Test Plan: evas_object_image_file_set(image, "./.9.png", NULL); Reviewers: Hermet, jsuya, herb Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11848
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c7
1 files changed, 6 insertions, 1 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 686cc2966c..0558c3e9cf 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
@@ -121,6 +121,8 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
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;
123 volatile Eina_Bool r = EINA_FALSE; 123 volatile Eina_Bool r = EINA_FALSE;
124 const char *filename;
125 unsigned int filename_len = 0;
124 126
125 *error = EVAS_LOAD_ERROR_NONE; 127 *error = EVAS_LOAD_ERROR_NONE;
126 128
@@ -238,7 +240,10 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
238 } 240 }
239 if (epi->hasa) prop->info.alpha = 1; 241 if (epi->hasa) prop->info.alpha = 1;
240 242
241 prop->need_data = eina_str_has_extension(eina_file_filename_get(f), ".9.png"); 243 filename = eina_file_filename_get(f);
244 if (filename) filename_len = strlen(filename);
245 prop->need_data = (filename_len > 6 && filename[filename_len - 7] != '/') &&
246 (eina_str_has_extension(filename, ".9.png"));
242 if (prop->need_data) 247 if (prop->need_data)
243 { 248 {
244 // Adjust size to take into account the 9 patch pixels information 249 // Adjust size to take into account the 9 patch pixels information