Skip to content

Commit

Permalink
recover from official develop branch to publish bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
for13to1 committed Dec 6, 2023
1 parent d3377e9 commit 9cf9b68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion YUViewLib/src/common/Typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ struct Size
{
return this->width != other.width || this->height != other.height;
}
constexpr bool isValid() const { return this->width > 0 && this->height > 0; }
constexpr bool isValid() const { return this->width != 0 && this->height != 0; }
unsigned width{};
unsigned height{};
};
Expand Down
22 changes: 1 addition & 21 deletions YUViewLib/src/playlistitem/playlistItemRawFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ playlistItemRawFile::playlistItemRawFile(const QString &rawFilePath,
QFileInfo fi(rawFilePath);
QString ext = fi.suffix();
ext = ext.toLower();
if (ext == "yuv" || ext == "nv21" || ext == "y4m" || fmt.toLower() == "yuv")
if (ext == "yuv" || ext == "nv21" || fmt.toLower() == "yuv" || ext == "y4m")
{
this->video = std::make_unique<video::yuv::videoHandlerYUV>();
this->rawFormat = video::RawFormat::YUV;
Expand All @@ -87,12 +87,6 @@ playlistItemRawFile::playlistItemRawFile(const QString &rawFilePath,
this->video = std::make_unique<video::rgb::videoHandlerRGB>();
this->rawFormat = video::RawFormat::RGB;
}
else if (ext == "rgba" || ext == "gbra" || ext == "bgra" || ext == "brga" ||
ext == "argb" || ext == "agbr" || ext == "abgr" || ext == "abrg")
{
this->video = std::make_unique<video::rgb::videoHandlerRGB>();
this->rawFormat = video::RawFormat::RGB;
}
else
Q_ASSERT_X(false, Q_FUNC_INFO, "No video handler for the raw file format found.");

Expand Down Expand Up @@ -566,22 +560,8 @@ void playlistItemRawFile::getSupportedFileExtensions(QStringList &allExtensions,
allExtensions.append("nv21");
allExtensions.append("y4m");

allExtensions.append("rgba");
allExtensions.append("rbga");
allExtensions.append("grba");
allExtensions.append("gbra");
allExtensions.append("brga");
allExtensions.append("bgra");
allExtensions.append("argb");
allExtensions.append("arbg");
allExtensions.append("agrb");
allExtensions.append("agbr");
allExtensions.append("abrg");
allExtensions.append("abgr");

filters.append("Raw YUV File (*.yuv *.nv21)");
filters.append("Raw RGB File (*.rgb *.rbg *.grb *.gbr *.brg *.bgr)");
filters.append("Raw RGBA File (*.rgba *.rbga *.grba *.gbra *.brga *.bgra *.argb *.arbg *.agrb *.agbr *.abrg *.abgr)");
filters.append("YUV4MPEG2 File (*.y4m)");
}

Expand Down

0 comments on commit 9cf9b68

Please sign in to comment.