diff --git a/frameworks/innerkitsimpl/common/src/pixel_map.cpp b/frameworks/innerkitsimpl/common/src/pixel_map.cpp index b23cc78fc027648a17940b32737bc4d206794051..2063e920cc4e9dd223f93f3a896150fbfe6e1dca 100644 --- a/frameworks/innerkitsimpl/common/src/pixel_map.cpp +++ b/frameworks/innerkitsimpl/common/src/pixel_map.cpp @@ -1044,7 +1044,6 @@ void PixelMap::ReleaseMemory(AllocatorType allocType, void *addr, void *context, } if (fd != nullptr) { ::close(*fd); - delete fd; } #endif } else if (allocType == AllocatorType::HEAP_ALLOC) { @@ -1338,6 +1337,9 @@ PixelMap *PixelMap::Unmarshalling(Parcel &parcel) uint32_t ret = pixelMap->SetImageInfo(imgInfo); if (ret != SUCCESS) { ReleaseMemory(allocType, base, context, bufferSize); + if (context != nullptr) { + delete static_cast(context); + } HiLog::Error(LABEL, "create pixel map from parcel failed, set image info error."); return nullptr; } diff --git a/frameworks/kits/js/common/image_source_napi.cpp b/frameworks/kits/js/common/image_source_napi.cpp index 1f0b3aca833897b46d3683bd3a421763be66a62c..0100147c2861e6bf28e2d0f537d47bf64d303309 100644 --- a/frameworks/kits/js/common/image_source_napi.cpp +++ b/frameworks/kits/js/common/image_source_napi.cpp @@ -365,8 +365,10 @@ static bool ParseDecodeOptions(napi_env env, napi_value root, DecodeOptions* opt HiLog::Debug(LABEL, "no sampleSize"); } - if (!GET_UINT32_BY_NAME(root, "rotateDegrees", opts->rotateNewDegrees)) { - HiLog::Debug(LABEL, "no rotateDegrees"); + if (!GET_UINT32_BY_NAME(root, "rotate", opts->rotateNewDegrees)) { + HiLog::Debug(LABEL, "no rotate"); + } else { + opts->rotateDegrees = (float)opts->rotateNewDegrees; } if (!GET_BOOL_BY_NAME(root, "editable", opts->editable)) { @@ -382,7 +384,7 @@ static bool ParseDecodeOptions(napi_env env, napi_value root, DecodeOptions* opt } if (!GET_NODE_BY_NAME(root, "desiredRegion", tmpValue)) { - HiLog::Debug(LABEL, "no rotateDegrees"); + HiLog::Debug(LABEL, "no desiredRegion"); } else { if (!ParseRegion(env, tmpValue, &(opts->desiredRegion))) { HiLog::Debug(LABEL, "ParseRegion error"); @@ -391,7 +393,7 @@ static bool ParseDecodeOptions(napi_env env, napi_value root, DecodeOptions* opt tmpNumber = 0; if (!GET_UINT32_BY_NAME(root, "desiredPixelFormat", tmpNumber)) { - HiLog::Debug(LABEL, "no rotateDegrees"); + HiLog::Debug(LABEL, "no desiredPixelFormat"); } else { opts->desiredPixelFormat = ParsePixlForamt(tmpNumber); } diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn index 76a585f0fccf73401c328625e7800e8804d48808..599d2f26633dc269350a323f7ce641aa0cde6866 100644 --- a/interfaces/innerkits/BUILD.gn +++ b/interfaces/innerkits/BUILD.gn @@ -31,6 +31,7 @@ config("image_external_config") { "//foundation/multimedia/utils/include", "//foundation/multimedia/image_standard/plugins/manager/include", "//foundation/multimedia/image_standard/interfaces/innerkits/include", + "//foundation/multimedia/image_standard/interfaces/kits/native/include", "//utils/jni/jnikit/include", "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", "//foundation/graphic/standard/interfaces/innerkits/surface", @@ -54,7 +55,6 @@ config("image_external_config") { include_dirs += [ "//utils/native/base/include", "//third_party/libpng", - "//third_party/libjpeg-turbo", "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", ] } @@ -181,10 +181,7 @@ ohos_shared_library("image_native") { if (DUAL_ADAPTER) { } else { - deps += [ - "//third_party/libjpeg-turbo:libjpeg-turbo", - "//third_party/libpng:libpng", - ] + deps += [ "//third_party/libpng:libpng" ] } external_deps = [ "bytrace_standard:bytrace_core", @@ -299,10 +296,7 @@ ohos_static_library("image_static") { if (DUAL_ADAPTER) { } else { - deps += [ - "//third_party/libjpeg-turbo:libjpeg-turbo", - "//third_party/libpng:libpng", - ] + deps += [ "//third_party/libpng:libpng" ] } } subsystem_name = "multimedia"