summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2023-09-12 15:01:56 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2023-09-12 15:01:56 +0300
commit87f496cf7c1c71510e4cb995661f8da5691746da (patch)
treefe9ba0551eebd3e217d65e57f5d688b6f483b523 /indra/llimage
parent7b54f077b48740c69559c0a2089b6133ed8eb605 (diff)
SL-20173 show notification when file is empty
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagedimensionsinfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp
index 5756ddb32b..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,7 +91,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()
if (signature[0] != 'B' || signature[1] != 'M')
{
LL_WARNS() << "Not a BMP" << LL_ENDL;
- mWarning = "IncorrectFormat";
+ mWarning = "texture_load_format_error";
return false;
}
@@ -141,7 +142,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)
{
LL_WARNS() << "Not a PNG" << LL_ENDL;
- mWarning = "IncorrectFormat";
+ mWarning = "texture_load_format_error";
return false;
}
@@ -185,7 +186,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)
{
LL_WARNS() << "Not a JPEG" << LL_ENDL;
- mWarning = "IncorrectFormat";
+ mWarning = "texture_load_format_error";
return false;
}
fseek(fp, 0, SEEK_SET); // go back to start of the file