forked from enlightenment/efl
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:
parent
323eb9fcff
commit
1230184ccf
|
@ -121,6 +121,8 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
|
||||||
Evas_Image_Load_Opts *opts = loader->opts;
|
Evas_Image_Load_Opts *opts = loader->opts;
|
||||||
Eina_File *f = loader->f;
|
Eina_File *f = loader->f;
|
||||||
volatile Eina_Bool r = EINA_FALSE;
|
volatile Eina_Bool r = EINA_FALSE;
|
||||||
|
const char *filename;
|
||||||
|
unsigned int filename_len = 0;
|
||||||
|
|
||||||
*error = EVAS_LOAD_ERROR_NONE;
|
*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;
|
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)
|
if (prop->need_data)
|
||||||
{
|
{
|
||||||
// Adjust size to take into account the 9 patch pixels information
|
// Adjust size to take into account the 9 patch pixels information
|
||||||
|
|
Loading…
Reference in New Issue