mirror of
https://gitee.com/openharmony/multimedia_image_framework
synced 2025-02-21 12:02:29 +00:00
commit
633c904ecc
@ -472,6 +472,9 @@ void ImageUtils::DumpPixelMap(PixelMap* pixelMap, std::string customFileName, ui
|
||||
#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM)
|
||||
if (pixelMap->GetAllocatorType() == AllocatorType::DMA_ALLOC) {
|
||||
auto sbBuffer = reinterpret_cast<SurfaceBuffer*>(pixelMap->GetFd());
|
||||
if (!sbBuffer) {
|
||||
return;
|
||||
}
|
||||
totalSize = static_cast<int32_t>(sbBuffer->GetSize());
|
||||
} else {
|
||||
totalSize = static_cast<int32_t>(pixelMap->GetCapacity());
|
||||
|
@ -755,6 +755,7 @@ static std::shared_ptr<ImageSource> GetImageSourceFromNapi(napi_env env, napi_va
|
||||
{
|
||||
if (env == nullptr || value == nullptr) {
|
||||
IMAGE_LOGE("GetImageSourceFromNapi input is null");
|
||||
return nullptr;
|
||||
}
|
||||
std::unique_ptr<ImageSourceNapi> imageSourceNapi = std::make_unique<ImageSourceNapi>();
|
||||
napi_status status = napi_unwrap(env, value, reinterpret_cast<void**>(&imageSourceNapi));
|
||||
|
@ -190,7 +190,11 @@ static ImageType ParserImageType(napi_env env, napi_value argv)
|
||||
bool isInstance = false;
|
||||
napi_status ret = napi_invalid_arg;
|
||||
|
||||
napi_get_global(env, &global);
|
||||
ret = napi_get_global(env, &global);
|
||||
if (ret != napi_ok) {
|
||||
IMAGE_LOGI("Get global failed!");
|
||||
return ImageType::TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
ret = napi_get_named_property(env, global, "PixelMap", &constructor);
|
||||
if (ret != napi_ok) {
|
||||
|
@ -893,7 +893,7 @@ uint32_t ExtDecoder::Decode(uint32_t index, DecodeContext &context)
|
||||
return res;
|
||||
}
|
||||
SkCodec::Result ret = codec_->getPixels(dstInfo_, dstBuffer, rowStride, &dstOptions_);
|
||||
if (ret != SkCodec::kSuccess && ResetCodec()) {
|
||||
if (ret != SkCodec::kSuccess && ResetCodec() && skEncodeFormat != SkEncodedImageFormat::kHEIF) {
|
||||
ret = codec_->getPixels(dstInfo_, dstBuffer, rowStride, &dstOptions_); // Try again
|
||||
}
|
||||
if (ret != SkCodec::kSuccess) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user