diff options
author | UbitUmarov | 2018-07-14 15:19:09 +0100 |
---|---|---|
committer | UbitUmarov | 2018-07-14 15:19:09 +0100 |
commit | 8ab5a87520fbf331286c1ef5bae9435c747b6b8f (patch) | |
tree | 5458049f14c7fe2143d8acfac6fae51d10f4aedd /OpenSim/Region | |
parent | do not use lossless compression on dyntextures (diff) | |
download | opensim-SC-8ab5a87520fbf331286c1ef5bae9435c747b6b8f.zip opensim-SC-8ab5a87520fbf331286c1ef5bae9435c747b6b8f.tar.gz opensim-SC-8ab5a87520fbf331286c1ef5bae9435c747b6b8f.tar.bz2 opensim-SC-8ab5a87520fbf331286c1ef5bae9435c747b6b8f.tar.xz |
only resize if need
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index e792746..4f18d00 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -249,10 +249,13 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
249 | newSize.Height = 1024; | 249 | newSize.Height = 1024; |
250 | } | 250 | } |
251 | 251 | ||
252 | using(Bitmap resize = new Bitmap(image, newSize)) | 252 | if(newSize.Width != image.Width || newSize.Height != image.Height) |
253 | { | 253 | { |
254 | imageJ2000 = OpenJPEG.EncodeFromImage(resize, false); | 254 | using(Bitmap resize = new Bitmap(image, newSize)) |
255 | imageJ2000 = OpenJPEG.EncodeFromImage(resize, false); | ||
255 | } | 256 | } |
257 | else | ||
258 | imageJ2000 = OpenJPEG.EncodeFromImage(image, false); | ||
256 | } | 259 | } |
257 | } | 260 | } |
258 | catch (Exception) | 261 | catch (Exception) |