diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp
index 4f29268e11..4fa44bac23 100644
--- a/indra/newview/daeexport.cpp
+++ b/indra/newview/daeexport.cpp
@@ -428,6 +428,8 @@ void ColladaExportFloater::CacheReadResponder::completed(bool success)
// For other formats we need to decode first
if (mFormattedImage->updateData() && ( (mFormattedImage->getWidth() * mFormattedImage->getHeight() * mFormattedImage->getComponents()) != 0 ) )
{
+ mFormattedImage->setDiscardLevel(0); // [FIRE-35292] Fix for textures getting downscaled and compressed
+
LLPointer raw = new LLImageRaw;
raw->resize(mFormattedImage->getWidth(), mFormattedImage->getHeight(), mFormattedImage->getComponents());
@@ -503,7 +505,15 @@ void ColladaExportFloater::CacheReadResponder::saveTexturesWorker(void* data)
std::string name = gDirUtilp->getDirName(me->mFilename);
name += gDirUtilp->getDirDelimiter() + me->mTexturesToSave[id];
CacheReadResponder* responder = new CacheReadResponder(id, img, name, img_type);
- LLAppViewer::getTextureCache()->readFromCache(id, 0, 999999, responder);
+ // [FIRE-35292] Fix for textures getting downscaled and compressed
+ //LLAppViewer::getTextureCache()->readFromCache(id, 0, 999999, responder);
+ // The above line hard coded the size of data to read from the cached version of the texture as 999999,
+ // where now we will calcuate the correct value based upon the texture's full width, height and # of components (3=RGB, 4=RGBA) and
+ // the discard level (0)). There is a choice to change the rate, but we seem to use the value of 1/8 compression level
+ S32 texture_size = LLImageJ2C::calcDataSizeJ2C(imagep->getFullWidth(), imagep->getFullHeight(), imagep->getComponents(), 0);// , F32 rate) rate = const F32 DEFAULT_COMPRESSION_RATE = 1.f/8.f;
+ // Use calculated texture_size (from LLTextureFetch::createRequest see "else if (w*h*c > 0)" statement for more info)
+ LLAppViewer::getTextureCache()->readFromCache(id, 0, texture_size, responder);
+ // [FIRE-35292]
me->mTexturesToSave.erase(id);
me->updateTitleProgress();
me->mTimer.reset();
diff --git a/indra/newview/fsfloaterexport.cpp b/indra/newview/fsfloaterexport.cpp
index 0b60e8b00b..a8f81eccaa 100644
--- a/indra/newview/fsfloaterexport.cpp
+++ b/indra/newview/fsfloaterexport.cpp
@@ -690,7 +690,14 @@ void FSFloaterObjectExport::fetchTextureFromCache(LLViewerFetchedTexture* src_vi
const LLUUID& texture_id = src_vi->getID();
LLImageJ2C* mFormattedImage = new LLImageJ2C;
FSFloaterObjectExport::FSExportCacheReadResponder* responder = new FSFloaterObjectExport::FSExportCacheReadResponder(texture_id, mFormattedImage, this);
- LLAppViewer::getTextureCache()->readFromCache(texture_id, 0, 999999, responder);
+ // [FIRE-35292] Fix for textures getting downscaled and compressed
+ //LLAppViewer::getTextureCache()->readFromCache(id, 0, 999999, responder);
+ // The above line hard coded the size of data to read from the cached version of the texture as 999999,
+ // where now we will calcuate the correct value based upon the texture's full width, height and # of components (3=RGB, 4=RGBA) and
+ // the discard level (0)). There is a choice to change the rate, but we seem to use the value of 1/8 compression level
+ S32 texture_size = LLImageJ2C::calcDataSizeJ2C(src_vi->getFullWidth(), src_vi->getFullHeight(), src_vi->getComponents(), 0);// , F32 rate) rate = const F32 DEFAULT_COMPRESSION_RATE = 1.f/8.f;
+ // Use calculated texture_size (from LLTextureFetch::createRequest see "else if (w*h*c > 0)" statement for more info)
+ LLAppViewer::getTextureCache()->readFromCache(texture_id, 0, texture_size, responder);
LL_DEBUGS("export") << "Fetching " << texture_id << " from the TextureCache" << LL_ENDL;
}
diff --git a/indra/newview/llagentbenefits.cpp b/indra/newview/llagentbenefits.cpp
index 5b737e35f3..01a701094d 100644
--- a/indra/newview/llagentbenefits.cpp
+++ b/indra/newview/llagentbenefits.cpp
@@ -220,7 +220,7 @@ S32 LLAgentBenefits::getPicksLimit() const
}
else
{
- constexpr S32 MAX_OPENSIM_PICKS_FALLBACK = 20; // [FIRE-35276] Freeze on OpenSim (default agreed with Ubit Umarov) (originally by Haklezz)
+ constexpr S32 MAX_OPENSIM_PICKS_FALLBACK = 20; // [FIRE-35276] Freeze on OpenSim (default agreed with Ubit Umarov) (originally by Hecklezz)
S32 max_profile_picks = MAX_OPENSIM_PICKS_FALLBACK;
@@ -234,7 +234,7 @@ S32 LLAgentBenefits::getPicksLimit() const
}
}
return max_profile_picks;
- }
+ }
//
}