Skip to content

Commit

Permalink
return NULL if thumbnail requested but not jpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
qbnu committed Jun 18, 2023
1 parent d29bfff commit 1adfcdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JPEGView/RAWWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1adfcdb

Please sign in to comment.