summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-03-28 21:49:58 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-03-31 09:56:10 +0300
commit8d5dab9f67d54ce20768c0ccda58f27693cb20c9 (patch)
tree0fe79bf228132552160f2b0dd60dfa389a5c9035 /indra/llimage
parentb1822e36e531a3c423404f0aa875cbf6949061a0 (diff)
#3809 Fix J2C Upload
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagedimensionsinfo.cpp20
-rw-r--r--indra/llimage/llimagedimensionsinfo.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp
index d4efbcfad2..49a1777fe5 100644
--- a/indra/llimage/llimagedimensionsinfo.cpp
+++ b/indra/llimage/llimagedimensionsinfo.cpp
@@ -27,6 +27,7 @@
#include "stdtypes.h"
#include "llimagejpeg.h"
+#include "llimagej2c.h"
#include "llimagedimensionsinfo.h"
@@ -63,6 +64,8 @@ bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec)
return getImageDimensionsTga();
case IMG_CODEC_JPEG:
return getImageDimensionsJpeg();
+ case IMG_CODEC_J2C:
+ return getImageDimensionsJ2c();
case IMG_CODEC_PNG:
return getImageDimensionsPng();
default:
@@ -214,6 +217,23 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
return !sJpegErrorEncountered;
}
+bool LLImageDimensionsInfo::getImageDimensionsJ2c()
+{
+ clean();
+
+ LLPointer<LLImageJ2C> jpeg_image = new LLImageJ2C;
+ if (jpeg_image->load(mSrcFilename))
+ {
+ mWidth = jpeg_image->getWidth();
+ mHeight = jpeg_image->getHeight();
+ return true;
+ }
+ mWarning = "texture_load_format_error";
+ LL_WARNS() << "J2C load error: " << LLImage::getLastThreadError() << LL_ENDL;
+
+ return false;
+}
+
bool LLImageDimensionsInfo::checkFileLength(S32 min_len)
{
// Make sure the file is not shorter than min_len bytes.
diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h
index 681d66ae4e..820cf33d7e 100644
--- a/indra/llimage/llimagedimensionsinfo.h
+++ b/indra/llimage/llimagedimensionsinfo.h
@@ -91,6 +91,7 @@ protected:
bool getImageDimensionsTga();
bool getImageDimensionsPng();
bool getImageDimensionsJpeg();
+ bool getImageDimensionsJ2c();
S32 read_s32()
{