Page MenuHomePhabricator

evas: use SEQUENTIAL for decoding png file
ClosedPublic

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

Details

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.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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.

src/modules/evas/image_loaders/png/evas_image_load_png.c
251

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
src/modules/evas/image_loaders/png/evas_image_load_png.c
128

if (is_for_head)

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

else

epi->map = eina_file_map_all(f, EINA_FILE_RANDOM);
kimcinoo added inline comments.May 6 2020, 8:29 PM
src/modules/evas/image_loaders/png/evas_image_load_png.c
251

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
src/modules/evas/image_loaders/png/evas_image_load_png.c
128

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.