From 1adfcdbba07f23f0d1018af82de9787d1126fea0 Mon Sep 17 00:00:00 2001 From: qbnu <93988953+qbnu@users.noreply.github.com> Date: Sun, 18 Jun 2023 03:17:12 -0400 Subject: [PATCH] return NULL if thumbnail requested but not jpeg --- src/JPEGView/RAWWrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JPEGView/RAWWrapper.cpp b/src/JPEGView/RAWWrapper.cpp index 8bead329..6b6df67a 100644 --- a/src/JPEGView/RAWWrapper.cpp +++ b/src/JPEGView/RAWWrapper.cpp @@ -18,7 +18,7 @@ CJPEGImage* RawReader::ReadImage(LPCTSTR strFileName, bool& bOutOfMemory, bool b int width, height, colors, bps; CJPEGImage* Image = NULL; - if (!bGetThumb || !RawProcessor.is_jpeg_thumb()) { + if (!bGetThumb) { RawProcessor.get_mem_image_format(&width, &height, &colors, &bps); if (bps != 8) { int j = 2; @@ -57,7 +57,7 @@ CJPEGImage* RawReader::ReadImage(LPCTSTR strFileName, bool& bOutOfMemory, bool b if (pPixelData) Image = new CJPEGImage(width, height, pPixelData, NULL, colors, 0, IF_CameraRAW, false, 0, 1, 0, NULL, false, metadata); - } else { + } else if (RawProcessor.is_jpeg_thumb()) { TJSAMP eChromoSubSampling; if (RawProcessor.unpack_thumb() != LIBRAW_SUCCESS) { RawProcessor.free_image();