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 6742eac2661adc4ac03f60b2d2ed3997fde848de..1b62e57b5d837dfc32ce1aa536881147d4578b87 100644 --- a/frameworks/kits/js/common/image_source_napi.cpp +++ b/frameworks/kits/js/common/image_source_napi.cpp @@ -372,6 +372,8 @@ static bool ParseDecodeOptions(napi_env env, napi_value root, DecodeOptions* opt 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)) { @@ -387,7 +389,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"); @@ -396,7 +398,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 50d8696763787eb212c34b2f5253a07ef5de3de7..599d2f26633dc269350a323f7ce641aa0cde6866 100644 --- a/interfaces/innerkits/BUILD.gn +++ b/interfaces/innerkits/BUILD.gn @@ -55,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", ] } @@ -182,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", @@ -300,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"