forked from enlightenment/efl
evas: use SEQUENTIAL for decoding png file
Summary: There was a mistake caused by "2a0eeba evas: fix png regression issue". The flag is_for_data was close_file before this commit. _evas_image_load_file_internal_head_png closes file if it is called only for header. So the close_file does not mean is_for_data. This patch is changing is_for_data to is_for_head, and make _evas_image_load_file_internal_head_png use EINA_FILE_SEQUENTIAL for data decoding. Reviewers: Hermet, jsuya, herb, raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11783
This commit is contained in:
parent
2e5e624702
commit
16378307fa
|
@ -116,7 +116,7 @@ static Eina_Bool
|
||||||
_evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
|
_evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
|
||||||
Evas_Image_Property *prop,
|
Evas_Image_Property *prop,
|
||||||
Evas_PNG_Info *epi,
|
Evas_PNG_Info *epi,
|
||||||
int *error, Eina_Bool is_for_data)
|
int *error, Eina_Bool is_for_head)
|
||||||
{
|
{
|
||||||
Evas_Image_Load_Opts *opts = loader->opts;
|
Evas_Image_Load_Opts *opts = loader->opts;
|
||||||
Eina_File *f = loader->f;
|
Eina_File *f = loader->f;
|
||||||
|
@ -125,10 +125,10 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
|
||||||
*error = EVAS_LOAD_ERROR_NONE;
|
*error = EVAS_LOAD_ERROR_NONE;
|
||||||
|
|
||||||
epi->hasa = 0;
|
epi->hasa = 0;
|
||||||
if (!is_for_data)
|
if (!is_for_head)
|
||||||
epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
|
|
||||||
else
|
|
||||||
epi->map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
epi->map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
||||||
|
else
|
||||||
|
epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
|
||||||
if (!epi->map)
|
if (!epi->map)
|
||||||
{
|
{
|
||||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||||
|
@ -219,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))
|
if (png_get_valid(epi->png_ptr, epi->info_ptr, PNG_INFO_tRNS))
|
||||||
{
|
{
|
||||||
/* expand transparency entry -> alpha channel if present */
|
/* expand transparency entry -> alpha channel if present */
|
||||||
if (!is_for_data) png_set_tRNS_to_alpha(epi->png_ptr);
|
if (!is_for_head) png_set_tRNS_to_alpha(epi->png_ptr);
|
||||||
epi->hasa = 1;
|
epi->hasa = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader,
|
||||||
|
|
||||||
r = EINA_TRUE;
|
r = EINA_TRUE;
|
||||||
|
|
||||||
if (!is_for_data) return r;
|
if (!is_for_head) return r;
|
||||||
|
|
||||||
close_file:
|
close_file:
|
||||||
if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr,
|
if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr,
|
||||||
|
|
Loading…
Reference in New Issue