Remove mmutil-png dependency 39/238339/8
authorhj kim <backto.kim@samsung.com>
Mon, 13 Jul 2020 02:40:48 +0000 (11:40 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 16 Jul 2020 01:54:11 +0000 (10:54 +0900)
mmutil-png used libpng but GraphicksMagicK(mmutil-magick) can cover it.
so remove mmutil-png dependency.

Change-Id: Ia5af763671514b9b1b9b77cc9d8098cd97e10297

CMakeLists.txt [changed mode: 0755->0644]
packaging/capi-media-image-util.spec [changed mode: 0755->0644]
src/image_util_decode.c
src/image_util_encode.c

old mode 100755 (executable)
new mode 100644 (file)
index fcd95bb..b7ce508
@@ -9,7 +9,7 @@ SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
 # for package file
-SET(dependents "dlog mmutil-magick mmutil-common mmutil-gif mmutil-png mmutil-jpeg mmutil-imgp capi-base-common capi-media-tool glib-2.0")
+SET(dependents "dlog mmutil-magick mmutil-common mmutil-gif mmutil-jpeg mmutil-imgp capi-base-common capi-media-tool glib-2.0")
 SET(pc_dependents "capi-base-common capi-media-tool")
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
old mode 100755 (executable)
new mode 100644 (file)
index 71aa93d..1f3beaf
@@ -1,6 +1,6 @@
 Name:       capi-media-image-util
 Summary:    A Image Utility library in Tizen Native API
-Version:    0.2.7
+Version:    0.2.8
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
@@ -10,7 +10,6 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(mmutil-common)
 BuildRequires:  pkgconfig(mmutil-jpeg)
 BuildRequires:  pkgconfig(mmutil-imgp)
-BuildRequires:  pkgconfig(mmutil-png)
 BuildRequires:  pkgconfig(mmutil-gif)
 BuildRequires:  pkgconfig(mmutil-magick)
 BuildRequires:  pkgconfig(capi-base-common)
index a48f70802910b6b014b8a4277e6ee27c8f95c812..585c010e2cd304c8a80fc66d50f7a78bcde362a2 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <mm_util_imgp.h>
 #include <mm_util_jpeg.h>
-#include <mm_util_png.h>
 #include <mm_util_gif.h>
 #include <mm_util_magick.h>
 #include <mm_util_image.h>
@@ -266,14 +265,6 @@ static int __image_util_decode_internal(decode_s *_handle, mm_util_image_h *imag
                                err = mm_util_decode_from_jpeg_memory(_handle->src_buffer, _handle->src_size, colorspace, downscale, image_info);
                }
                break;
-       case IMAGE_UTIL_PNG:
-               {
-                       if (_handle->path)
-                               err = mm_util_decode_from_png_file(_handle->path, image_info);
-                       else
-                               err = mm_util_decode_from_png_memory(_handle->src_buffer, _handle->src_size, image_info);
-               }
-               break;
        case IMAGE_UTIL_GIF:
                {
                        if (_handle->path)
@@ -282,6 +273,8 @@ static int __image_util_decode_internal(decode_s *_handle, mm_util_image_h *imag
                                err = mm_util_decode_from_gif_memory(_handle->src_buffer, _handle->src_size, image_info);
                }
                break;
+       case IMAGE_UTIL_PNG:
+               /* fall through */
        case IMAGE_UTIL_BMP:
                {
                        if (_handle->path)
@@ -367,14 +360,12 @@ static int __image_util_decode_run_from_file(image_util_decode_h handle, const c
                }
                break;
 
-       case IMAGE_UTIL_PNG:
-               ret = mm_util_decode_from_png_file(file_path, image);
-               break;
-
        case IMAGE_UTIL_GIF:
                ret = mm_util_decode_from_gif_file(file_path, image);
                break;
 
+       case IMAGE_UTIL_PNG:
+               /* fall through */
        case IMAGE_UTIL_BMP:
                ret = mm_util_decode_image_from_file(file_path, _handle->colorspace, image);
                break;
@@ -417,15 +408,17 @@ static int __image_util_decode_run_from_buffer(image_util_decode_h handle, const
                        ret = mm_util_decode_from_jpeg_memory((void *)buffer, buffer_size, colorspace, downscale, image);
                }
                break;
-       case IMAGE_UTIL_PNG:
-               ret = mm_util_decode_from_png_memory((void *)buffer, buffer_size, image);
-               break;
+
        case IMAGE_UTIL_GIF:
                ret = mm_util_decode_from_gif_memory((void *)buffer, buffer_size, image);
                break;
+
+       case IMAGE_UTIL_PNG:
+               /* fall through */
        case IMAGE_UTIL_BMP:
                ret = mm_util_decode_image_from_buffer((void *)buffer, buffer_size, _handle->colorspace, image);
                break;
+
        default:
                image_util_error("Not supported format [%d]", image_type);
                return IMAGE_UTIL_ERROR_INVALID_PARAMETER;
index 2307b17b6392eca68cc4739e2ac48ac98005468e..509e0e06915fb1cc05e7d2cc7a324affe1f54ebf 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <mm_util_imgp.h>
 #include <mm_util_jpeg.h>
-#include <mm_util_png.h>
 #include <mm_util_gif.h>
 #include <mm_util_magick.h>
 #include <mm_util_image.h>
@@ -56,7 +55,6 @@ typedef struct {
        size_t dst_size;
        gchar *path;
        int quality;
-       image_util_png_compression_e compression;
        gif_encode_s gif_encode_info;
        encode_cb_s *_encode_cb;
        mm_util_enc_opt_h enc_opt;
@@ -126,7 +124,6 @@ int image_util_encode_create(image_util_type_e image_type, image_util_encode_h *
        _handle->dst_buffer = NULL;
        _handle->path = NULL;
        _handle->quality = 75;
-       _handle->compression = IMAGE_UTIL_PNG_COMPRESSION_6;
 
        err = mm_util_enc_opt_create(&_handle->enc_opt);
        if (err != MM_UTIL_ERROR_NONE) {
@@ -238,13 +235,8 @@ int image_util_encode_set_png_compression(image_util_encode_h handle, image_util
        encode_s *_handle = (encode_s *) handle;
 
        image_util_retvm_if(!_handle, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
-       IMAGE_UTIL_SUPPORT_TYPE_CHECK(_handle->image_type, IMAGE_UTIL_PNG);
 
-       image_util_retvm_if((compression < IMAGE_UTIL_PNG_COMPRESSION_0 || compression > IMAGE_UTIL_PNG_COMPRESSION_9), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid compression value");
-
-       _handle->compression = compression;
-
-       return IMAGE_UTIL_ERROR_NONE;
+       return _image_error_capi(mm_util_enc_opt_set_png_compression(_handle->enc_opt, compression));
 }
 
 int image_util_encode_set_gif_frame_delay_time(image_util_encode_h handle, unsigned long long delay_time)
@@ -355,14 +347,6 @@ static int __image_util_encode_internal(encode_s * _handle)
                                err = mm_util_encode_to_jpeg_memory(_src, _handle->quality, _handle->dst_buffer, &_handle->dst_size);
                }
                break;
-       case IMAGE_UTIL_PNG:
-               {
-                       if (_handle->path)
-                               err = mm_util_encode_to_png_file(_src, _handle->compression, _handle->path);
-                       else
-                               err = mm_util_encode_to_png_memory(_src, _handle->compression, _handle->dst_buffer, &_handle->dst_size);
-               }
-               break;
        case IMAGE_UTIL_GIF:
                {
                        image_util_debug("[Count] source_count:%u, buffer:%u, resolution:%u, delay:%u", _handle->gif_encode_info.source_count, _handle->gif_encode_info.current_buffer_count, _handle->gif_encode_info.current_resolution_count, _handle->gif_encode_info.current_delay_count);
@@ -377,6 +361,8 @@ static int __image_util_encode_internal(encode_s * _handle)
                                err = mm_util_encode_to_gif_memory((mm_util_image_h *)_handle->gif_encode_info.sources, _handle->gif_encode_info.source_count, _handle->dst_buffer, &_handle->dst_size);
                }
                break;
+       case IMAGE_UTIL_PNG:
+               /* fall through */
        case IMAGE_UTIL_BMP:
                {
                        if (_handle->path)
@@ -417,14 +403,12 @@ static int __image_util_encode_run_to_file(image_util_encode_h handle, image_uti
                ret = mm_util_jpeg_encode_to_file(image, _handle->quality, file_path);
                break;
 
-       case IMAGE_UTIL_PNG:
-               ret = mm_util_encode_to_png_file(image, _handle->compression, file_path);
-               break;
-
        case IMAGE_UTIL_GIF:
                ret = mm_util_encode_to_gif_file(&image, 1, file_path);
                break;
 
+       case IMAGE_UTIL_PNG:
+               /* fall through */
        case IMAGE_UTIL_BMP:
                ret = mm_util_encode_image_to_file(image, _handle->enc_opt, file_path);
                break;
@@ -456,14 +440,12 @@ static int __image_util_encode_run_to_buffer(image_util_encode_h handle, image_u
                ret = mm_util_encode_to_jpeg_memory(image, _handle->quality, (void **)buffer, buffer_size);
                break;
 
-       case IMAGE_UTIL_PNG:
-               ret = mm_util_encode_to_png_memory(image, _handle->compression, (void **)buffer, buffer_size);
-               break;
-
        case IMAGE_UTIL_GIF:
                ret = mm_util_encode_to_gif_memory(&image, 1, (void **)buffer, buffer_size);
                break;
 
+       case IMAGE_UTIL_PNG:
+               /* fall through */
        case IMAGE_UTIL_BMP:
                ret = mm_util_encode_image_to_buffer(image, _handle->enc_opt, (void **)buffer, buffer_size);
                break;