diff --git a/YUViewLib/src/playlistitem/playlistItemRawFile.cpp b/YUViewLib/src/playlistitem/playlistItemRawFile.cpp index d3d2054fb..0ae98f5fb 100644 --- a/YUViewLib/src/playlistitem/playlistItemRawFile.cpp +++ b/YUViewLib/src/playlistitem/playlistItemRawFile.cpp @@ -104,6 +104,10 @@ playlistItemRawFile::playlistItemRawFile(const QString &rawFilePath, { this->video = std::make_unique(); this->rawFormat = video::RawFormat::YUV; + if (isInExtensions(ext, RAW_BAYER_EXTENSIONS)) + { + this->getYUVVideo()->setPixelFormatYUV(video::yuv::PixelFormatYUV(video::yuv::Subsampling::YUV_400, 8, video::yuv::PlaneOrder::YUV)); + } } else if (isInExtensions(ext, RGB_EXTENSIONS) || isInExtensions(ext, RGBA_EXTENSIONS) || isInExtensions(ext, CMYK_EXTENSIONS) || fmt.toLower() == "rgb") diff --git a/YUViewLib/src/video/yuv/PixelFormatYUVGuess.cpp b/YUViewLib/src/video/yuv/PixelFormatYUVGuess.cpp index 69a8d43ea..94300d437 100644 --- a/YUViewLib/src/video/yuv/PixelFormatYUVGuess.cpp +++ b/YUViewLib/src/video/yuv/PixelFormatYUVGuess.cpp @@ -243,6 +243,8 @@ checkSpecificFileExtensions(const GuessedFrameFormat &guessedFrameFormat, { const auto rawBayerFormat = PixelFormatYUV(Subsampling::YUV_400, guessedFrameFormat.bitDepth.value_or(8)); + if (!guessedFrameFormat.frameSize) + return rawBayerFormat; if (doesPixelFormatMatchFileSize( rawBayerFormat, *guessedFrameFormat.frameSize, fileInfo.fileSize)) return rawBayerFormat;