summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-30 12:28:26 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-30 12:28:26 +0200
commit0465c761a4cd14003d57d33f5edaa185d6fd7a01 (patch)
tree76f09c1be0da0b960bc4e18378c07439fbe0071f /indra/llimage
parent683bf84bb38adc88d4a4b7fedaed89b41fcac45e (diff)
parent43cf06b79e1a7d514f939b9511c3100da2768169 (diff)
Merge branch 'DRTVWR-588-maint-W' into marchcat/588-w-pbr-merge
# Conflicts: # indra/llrender/llgl.cpp # indra/llrender/llvertexbuffer.cpp # indra/llui/llflatlistview.cpp # indra/newview/lldrawpoolground.cpp # indra/newview/llspatialpartition.cpp # indra/newview/lltexturefetch.cpp # indra/newview/llviewergenericmessage.cpp # indra/newview/llviewertexture.cpp # indra/newview/llvosky.cpp # indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml # indra/newview/skins/default/xui/en/floater_stats.xml # indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml # indra/newview/skins/default/xui/en/notifications.xml # indra/newview/skins/default/xui/en/panel_performance_preferences.xml
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagedimensionsinfo.cpp4
-rw-r--r--indra/llimage/llimagedimensionsinfo.h7
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;