summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagedimensionsinfo.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-10 10:29:47 +0300
committerGitHub <noreply@github.com>2024-04-10 10:29:47 +0300
commit5118ba7adfc6f49f5b23694507dc7ceb8365b969 (patch)
tree4e499acfe5617682c5eca52998b5c10cdac8609a /indra/llimage/llimagedimensionsinfo.cpp
parent16e638db975278f6018fe1e21ba1954b7f159149 (diff)
parent84dfe55810815e8c274044cea5c81aaed89a787f (diff)
Merge pull request #1179 from secondlife/marchcat/y-merge
Release (Maint W) -> Maint YZ merge
Diffstat (limited to 'indra/llimage/llimagedimensionsinfo.cpp')
-rw-r--r--indra/llimage/llimagedimensionsinfo.cpp4
1 files changed, 4 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