Page MenuHomePhabricator

evas: use SEQUENTIAL for decoding png file

Authored by kimcinoo on May 6 2020, 8:09 PM.



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.

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
kimcinoo created this revision.May 6 2020, 8:09 PM
kimcinoo requested review of this revision.May 6 2020, 8:09 PM
Hermet requested changes to this revision.May 6 2020, 8:23 PM

Please check comments.


if (is_for_head) return r;

This revision now requires changes to proceed.May 6 2020, 8:23 PM
Hermet added inline comments.May 6 2020, 8:25 PM

if (is_for_head)

epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);


epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
kimcinoo added inline comments.May 6 2020, 8:29 PM

No. The variable is_for_head (and is_for_data) was close_file.
If this function is called only for head decoding, then is_for_head (is_for_data, close_file) is TRUE.
If this function is called not only for head decoding and data decoding, it should return here without calling png_destroy_read_sturct,
because the epi->png_ptr is used after exiting this function.

kimcinoo added inline comments.May 6 2020, 10:28 PM

Do you want to change the condition to (is_for_head) from (!is_for_head)?
Or you mean that the RANDOM should be called when the is_for_head is TRUE? - Yes this is right.
Anyway both if and else condition do the same thing, RANDOM.

raster accepted this revision.May 7 2020, 12:56 AM
This revision was not accepted when it landed; it landed in state Needs Revision.May 7 2020, 12:57 AM
This revision was automatically updated to reflect the committed changes.