aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2018-07-14 15:13:21 +0100
committerUbitUmarov2018-07-14 15:13:21 +0100
commit84235900b284e7377b802a626f64edaaec39159a (patch)
tree02de5d39ed8a5a17103b54607a9af9a4e73838e0
parentadd missing xml escape (diff)
downloadopensim-SC-84235900b284e7377b802a626f64edaaec39159a.zip
opensim-SC-84235900b284e7377b802a626f64edaaec39159a.tar.gz
opensim-SC-84235900b284e7377b802a626f64edaaec39159a.tar.bz2
opensim-SC-84235900b284e7377b802a626f64edaaec39159a.tar.xz
do not use lossless compression on dyntextures
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs73
2 files changed, 38 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
index 090cb7d..00c4682 100644
--- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
588 588
589 try 589 try
590 { 590 {
591 result = OpenJPEG.EncodeFromImage(joint, true); 591 result = OpenJPEG.EncodeFromImage(joint, false);
592 } 592 }
593 catch (Exception e) 593 catch (Exception e)
594 { 594 {
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
index 673a453..e792746 100644
--- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs
@@ -215,43 +215,44 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
215 { 215 {
216 try 216 try
217 { 217 {
218 Bitmap image = new Bitmap(stream); 218 using(Bitmap image = new Bitmap(stream))
219
220 // TODO: make this a bit less hard coded
221 if ((image.Height < 64) && (image.Width < 64))
222 {
223 newSize.Width = 32;
224 newSize.Height = 32;
225 }
226 else if ((image.Height < 128) && (image.Width < 128))
227 {
228 newSize.Width = 64;
229 newSize.Height = 64;
230 }
231 else if ((image.Height < 256) && (image.Width < 256))
232 {
233 newSize.Width = 128;
234 newSize.Height = 128;
235 }
236 else if ((image.Height < 512 && image.Width < 512))
237 {
238 newSize.Width = 256;
239 newSize.Height = 256;
240 }
241 else if ((image.Height < 1024 && image.Width < 1024))
242 {
243 newSize.Width = 512;
244 newSize.Height = 512;
245 }
246 else
247 {
248 newSize.Width = 1024;
249 newSize.Height = 1024;
250 }
251
252 using (Bitmap resize = new Bitmap(image, newSize))
253 { 219 {
254 imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); 220 // TODO: make this a bit less hard coded
221 if((image.Height < 64) && (image.Width < 64))
222 {
223 newSize.Width = 32;
224 newSize.Height = 32;
225 }
226 else if((image.Height < 128) && (image.Width < 128))
227 {
228 newSize.Width = 64;
229 newSize.Height = 64;
230 }
231 else if((image.Height < 256) && (image.Width < 256))
232 {
233 newSize.Width = 128;
234 newSize.Height = 128;
235 }
236 else if((image.Height < 512 && image.Width < 512))
237 {
238 newSize.Width = 256;
239 newSize.Height = 256;
240 }
241 else if((image.Height < 1024 && image.Width < 1024))
242 {
243 newSize.Width = 512;
244 newSize.Height = 512;
245 }
246 else
247 {
248 newSize.Width = 1024;
249 newSize.Height = 1024;
250 }
251
252 using(Bitmap resize = new Bitmap(image, newSize))
253 {
254 imageJ2000 = OpenJPEG.EncodeFromImage(resize, false);
255 }
255 } 256 }
256 } 257 }
257 catch (Exception) 258 catch (Exception)