Commit Graph

23 Commits

Author SHA1 Message Date
Elyes HAOUAS 2c8baa76f1 Fix typos - (Part #3)
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12017
2020-07-06 10:52:51 +02:00
Shinwoo Kim 9c0484c9cb 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
2020-05-19 11:57:56 +09:00
Shinwoo Kim 5f159ae624 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
2020-05-08 19:26:46 +09:00
Shinwoo Kim 5801bc07f5 evas: fix png regression issue
Summary:
Accidentally commit "382c580 evas: add support for .9.png file to PNG loader."
adding the 9 patch feature with small code refactoring made use of setjmp
incorrectly.

[Problem]
evas_image_load_file_data_png calls _evas_image_load_file_internal_head_png,
and _evas_image_load_file_internal_head_png calls setjmp and returns without
problem. And png_read_row calls longjmp. This causes jumping into a function
which was exited. Problematic png file will be attached.

[Solution]
Save calling environment i.e. call setjmp, after returning from
_evas_image_load_file_internal_head_png.

Test Plan:
Problematic png file
{F3876983}

And example code.
{F3876986}

Reviewers: Hermet, jsuya, herb

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11782
2020-05-07 12:15:02 +09:00
Shinwoo Kim 2a0eeba4e5 evas: fix png regression issue
Accidentally commit "382c580 evas: add support for .9.png file to PNG loader."
adding the 9 patch feature with small code refactoring missed a line calling
eina_file_map_all taking EINA_FILE_SEQUENTIAL for data decoding.

You can see the previous change adding the line from the following commit.

   e60baa0 evas: change mapping policy to be less agressive into loading file
           in memory.

This is a response to the request of @cedric on D9580

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9614
2019-08-19 16:47:22 -07:00
Shinwoo Kim f5aa672853 evas: fix png regression issue
Summary:
The evas_image_load_file_data_png had called png_set_tRNS_to_alpha
from following commit.

   6988a38 evas: fix png loader to actually produce lower resolution
           content when asked.

You could refer to following information regarding png_set_tRNS_to_alpha
which is available on page http://www.libpng.org/pub/png/libpng-manual.txt

   The following code transforms grayscale images of less than 8 to 8 bits,
   changes paletted images to RGB, and adds a full alpha channel if there is
   transparency information in a tRNS chunk.  This is most useful on
   grayscale images with bit depths of 2 or 4 or if there is a multiple-image
   viewing application that wishes to treat all images in the same way.

       if (color_type == PNG_COLOR_TYPE_PALETTE)
           png_set_palette_to_rgb(png_ptr);

       if (png_get_valid(png_ptr, info_ptr,
           PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);

       if (color_type == PNG_COLOR_TYPE_GRAY &&
           bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr)

Accidentally commit "382c580 evas: add support for .9.png file to PNG loader."
adding a new feature with small code refactoring missed the line calling
png_set_tRNS_to_alpha.

So we got a rendering issue. It made around 75% size white rectangle
using a grayscale and transparent image. I'd like to attach the image
which has following type information for test purpose.

$ identify -verbose ./grayscale_transparent.png | grep type -i
  Mime type: image/png
  Type: Bilevel
    png:IHDR.color-type-orig: 0
    png:IHDR.color_type: 0 (Grayscale)

Test Plan:
This is the sample image file grayscale_transparent.png

{F3748665}

Reviewers: cedric, Hermet, jsuya

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9580
2019-08-16 16:55:12 +09:00
Carsten Haitzler e0f0165220 evas - png loader - fix leake in error case of pixels
fix CID 1403027

@fix
2019-08-11 12:47:37 +01:00
Boris Faure cdb920ab08 get rid of shadow variables
Summary: gl: add some EINA_FALLTHROUGH

Reviewers: #reviewers, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9525
2019-08-08 17:18:46 -04:00
Cedric BAIL 382c580182 evas: add support for .9.png file to PNG loader.
This support Android 9 patch file format. Only black is a recognized color for both
the stretch area and the content area. All other color are associated with being
"white".

Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9103
2019-07-12 09:54:18 -07:00
Cedric BAIL ce076d1323 evas: break Image_Loader API to allow for getting property from the data field of an image.
Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9101
2019-07-12 09:54:14 -07:00
Cedric BAIL 9f35c74d9d evas: break Evas_Loader API and introduce a version numbering for Image_Loader.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9099
2019-07-12 09:54:11 -07:00
Vincent Torri 24e4881efb Evas: remove Evil.h when not needed and use evil_private when needed
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8921
2019-05-20 08:46:02 -04:00
Hermet Park 7ef58f9581 evas png: apply interpolation when scale down image loading.
Summary:
This patch improves png quality when image uses scale-down at image loading.

Since current scale-down logic just works like point sampling,
image result could be wholely different,

Simply, if source data is consist of continous white and black pixels,
and scale down factor is 2, the sampled data would be only white,
and lose all black pixels, or vice versa.

The result can be unexpected by users.
Even current jpeg scale-down works with interpolation.

Before:
{F3711651}

After:
{F3711652}

Original:
{F3711653}

Reviewers: cedric, raster, #committers, kimcinoo, jsuya

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8788
2019-05-13 15:47:22 +09:00
Hermet Park ebd8b21d30 Revert "evas png: apply interpolation when scale down image loading."
This reverts commit 53cdf850ba.

It's still on reviewing, I didn't intend submitting.
2019-05-02 20:19:24 +09:00
Hermet Park 53cdf850ba evas png: apply interpolation when scale down image loading.
Summary:
This patch improves png quality when image uses scale-down at image loading.

Since current scale-down logic just works like point sampling,
image result could be wholely different,

Simply, if source data is consist of continous white and black pixels,
and scale down factor is 2, the sampled data would be only white,
and lose all black pixels, or vice versa.

The result can be unexpected by users.
Even current jpeg scale-down works with interpolation.

Before:
{F3711651}

After:
{F3711652}

Original:
{F3711653}

Reviewers: cedric, raster, #committers, kimcinoo, jsuya

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8788
2019-05-02 17:02:00 +09:00
Hermet Park 1f438bd1f0 evas png loader: optimize scale down logic.
Previously, mannual scale down logic was too primitive,
it copied pixel data each channels. Obviously, it's ineffective.

We know the general case - 4 bytes channel which is the most usage,
If loader copies data per four bytes, instructions could be reduced.

When I load scale-downed image(original 8k), about 0.02 secs was reduced by this.
2019-04-29 20:02:34 +09:00
Pawel Aksiutowicz 56abebf236 evas: remove warning from image_loaders/png/evas_image_load_png
Reviewers: stanluk, lukasz.stanislawski, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5501

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-11-23 15:43:38 -08:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Carsten Haitzler 9e01cf2698 evas image async preload - add option to also make header load async
to date if you use async preload we still load the header
synchronously and this can be horrible especially with generic
loaders. there is no way to farm this off to the preload thread. now
there is. youhave to set it as a skip head load option before doing a
file_set AND you need to issue a preload ... but now it's possible.

@feature
2017-01-02 18:53:56 +09:00
Jean-Philippe Andre 0193e40d8c evas: Fix region test in jpeg load with region + zoom
The previous commit exposed an issue with the region test
does not take into account the scale down factor.

Not a @fix in itself, as it depends on the previous patch.
2016-08-17 17:28:53 +09:00
jiin.moon 922a1bcd9e evas: Add support for region load with PNG files
Summary:
PNG loader support  region_set when decoding
@feature

Reviewers: cedric, jpeg, jypark, raster

Subscribers: raster

Differential Revision: https://phab.enlightenment.org/D4165
2016-08-17 17:28:53 +09:00
Cedric BAIL d22155487b evas: get rid of clobbered warning. 2015-04-25 19:59:18 +02:00
Bogdan Devichev 043055fc8e evas: preparation of places for model_saver_loader separated from image_saver_loader. 2014-12-23 21:13:43 +01:00