X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fbitmapvalidator.cpp;h=c2a4a3c7cca47d8e71981f03e270c2c63fc064be;hb=f8c0410b12183ecb40aafbb44086fa146b25b528;hp=771b707eca577677011710deeb137206f86541bc;hpb=dec33c63afafabf83c3039e916725cac6faef9b3;p=fms.git diff --git a/src/bitmapvalidator.cpp b/src/bitmapvalidator.cpp index 771b707..c2a4a3c 100644 --- a/src/bitmapvalidator.cpp +++ b/src/bitmapvalidator.cpp @@ -6,6 +6,16 @@ #include #include +BitmapValidator::BitmapValidator():m_maxwidth(-1),m_maxheight(-1) +{ + +} + +BitmapValidator::~BitmapValidator() +{ + +} + const bool BitmapValidator::Validate(const std::vector &data) { bool validated=false; @@ -20,7 +30,15 @@ const bool BitmapValidator::Validate(const std::vector &data) BMP temp; if(temp.ReadFromFile(tempname.c_str())) { - validated=true; + validated=true; + if(m_maxwidth!=-1 && temp.TellWidth()>m_maxwidth) + { + validated=false; + } + if(m_maxheight!=-1 && temp.TellHeight()>m_maxheight) + { + validated=false; + } } unlink(tempname.c_str());