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
This commit is contained in:
Shinwoo Kim 2020-05-19 11:57:55 +09:00 committed by Hermet Park
parent 93cddac02d
commit 9c0484c9cb
1 changed files with 6 additions and 1 deletions

View File

@ -121,6 +121,8 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
Evas_Image_Load_Opts *opts = loader->opts;
Eina_File *f = loader->f;
volatile Eina_Bool r = EINA_FALSE;
const char *filename;
unsigned int filename_len = 0;
*error = EVAS_LOAD_ERROR_NONE;
@ -238,7 +240,10 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
}
if (epi->hasa) prop->info.alpha = 1;
prop->need_data = eina_str_has_extension(eina_file_filename_get(f), ".9.png");
filename = eina_file_filename_get(f);
if (filename) filename_len = strlen(filename);
prop->need_data = (filename_len > 6 && filename[filename_len - 7] != '/') &&
(eina_str_has_extension(filename, ".9.png"));
if (prop->need_data)
{
// Adjust size to take into account the 9 patch pixels information