summaryrefslogtreecommitdiff
path: root/indra/newview/lllocalbitmaps.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-05-28 22:48:17 +0300
committerGitHub <noreply@github.com>2025-05-28 22:48:17 +0300
commit91adb11d10fe0c18790be64fa7a6ce5b0bbdcb09 (patch)
tree3e5294e3b8ff07778e6134ed9dd41458386032ac /indra/newview/lllocalbitmaps.cpp
parentb9ab6c3644da02bed6941dc8df433fb1c626f8c7 (diff)
parentb08ba3fa7bc9e6309891e510fbfb5c4e2b5c922e (diff)
Merge pull request #4183 from secondlife/marchcat/2505-merge
Marchcat/2505 merge
Diffstat (limited to 'indra/newview/lllocalbitmaps.cpp')
-rw-r--r--indra/newview/lllocalbitmaps.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 101ee215cb..e31fbb188a 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -38,6 +38,7 @@
/* image compression headers. */
#include "llimagebmp.h"
#include "llimagetga.h"
+#include "llimagej2c.h"
#include "llimagejpeg.h"
#include "llimagepng.h"
@@ -106,6 +107,10 @@ LLLocalBitmap::LLLocalBitmap(std::string filename)
{
mExtension = ET_IMG_JPG;
}
+ else if (temp_exten == "j2c" || temp_exten == "jp2")
+ {
+ mExtension = ET_IMG_J2C;
+ }
else if (temp_exten == "png")
{
mExtension = ET_IMG_PNG;
@@ -354,6 +359,21 @@ bool LLLocalBitmap::decodeBitmap(LLPointer<LLImageRaw> rawimg)
break;
}
+ case ET_IMG_J2C:
+ {
+ LLPointer<LLImageJ2C> jpeg_image = new LLImageJ2C;
+ if (jpeg_image->load(mFilename))
+ {
+ jpeg_image->setDiscardLevel(0);
+ if (jpeg_image->decode(rawimg, 0.0f))
+ {
+ rawimg->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+ decode_successful = true;
+ }
+ }
+ break;
+ }
+
case ET_IMG_PNG:
{
LLPointer<LLImagePNG> png_image = new LLImagePNG;