diff options
Diffstat (limited to 'indra/llimage')
| -rw-r--r-- | indra/llimage/llimagedimensionsinfo.cpp | 4 | ||||
| -rw-r--r-- | indra/llimage/llimagedimensionsinfo.h | 7 | 
2 files changed, 11 insertions, 0 deletions
| diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 97b543f3b6..9dd69ff132 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -50,6 +50,7 @@ bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec)  	if (file_size == 0)  	{ +        mWarning = "texture_load_empty_file";  		setLastError("File is empty",src_filename);  		return false;  	} @@ -90,6 +91,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()  	if (signature[0] != 'B' || signature[1] != 'M')  	{  		LL_WARNS() << "Not a BMP" << LL_ENDL; +        mWarning = "texture_load_format_error";  		return false;  	} @@ -140,6 +142,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()  	if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)  	{  		LL_WARNS() << "Not a PNG" << LL_ENDL; +        mWarning = "texture_load_format_error";  		return false;  	} @@ -183,6 +186,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()  	if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)  	{  		LL_WARNS() << "Not a JPEG" << LL_ENDL; +        mWarning = "texture_load_format_error";  		return false;  	}  	fseek(fp, 0, SEEK_SET); // go back to start of the file diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h index 8f716c5d02..ade283bb85 100644 --- a/indra/llimage/llimagedimensionsinfo.h +++ b/indra/llimage/llimagedimensionsinfo.h @@ -55,6 +55,12 @@ public:  	{  		return mLastError;  	} + +    const std::string& getWarningName() +    { +        return mWarning; +    } +  protected:  	void clean() @@ -129,6 +135,7 @@ protected:  	std::string mSrcFilename;  	std::string mLastError; +    std::string mWarning;  	U8* mData; | 
