summaryrefslogtreecommitdiff
path: root/src/modules/evas/image_savers
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-12-22 19:00:41 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-12-22 19:23:01 +0900
commit2f1d666a06d374d1930cf69cf72f21c9700caf46 (patch)
tree523b35cf7e0b2b2569b7b885cfeb52f51c56b7c7 /src/modules/evas/image_savers
parent3be0e7b63b7f9df2241e854eabd8ef924978783a (diff)
evas: PNG save of ARGY88 needs unpremul
PNG saves unpremultiplied values, so we need to do that for the newly supported ARGY88 colorspace as well. Fixes the previous commit.
Diffstat (limited to 'src/modules/evas/image_savers')
-rw-r--r--src/modules/evas/image_savers/png/evas_image_save_png.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/evas/image_savers/png/evas_image_save_png.c b/src/modules/evas/image_savers/png/evas_image_save_png.c
index 6eef2fe221..eca98f8ab7 100644
--- a/src/modules/evas/image_savers/png/evas_image_save_png.c
+++ b/src/modules/evas/image_savers/png/evas_image_save_png.c
@@ -88,7 +88,16 @@ save_image_png(RGBA_Image *im, const char *file, int do_compress, int interlace)
88 { 88 {
89 agry88 = EINA_TRUE; 89 agry88 = EINA_TRUE;
90 pixel_size = 2; 90 pixel_size = 2;
91 data = im->image.data8; 91 data = malloc(im->cache_entry.w * im->cache_entry.h * pixel_size);
92 if (!data)
93 {
94 png_destroy_write_struct(&png_ptr, (png_infopp) & info_ptr);
95 png_destroy_info_struct(png_ptr, (png_infopp) & info_ptr);
96 goto close_file;
97 }
98 free_data = EINA_TRUE;
99 memcpy(data, im->image.data, im->cache_entry.w * im->cache_entry.h * pixel_size);
100 evas_common_convert_ag_unpremul((DATA16 *) data, im->cache_entry.w * im->cache_entry.h);
92 png_init_io(png_ptr, f); 101 png_init_io(png_ptr, f);
93 png_set_IHDR(png_ptr, info_ptr, im->cache_entry.w, im->cache_entry.h, 8, 102 png_set_IHDR(png_ptr, info_ptr, im->cache_entry.w, im->cache_entry.h, 8,
94 PNG_COLOR_TYPE_GRAY_ALPHA, interlace, 103 PNG_COLOR_TYPE_GRAY_ALPHA, interlace,