only resize if need

0.9.1.0-post-fixes
UbitUmarov 2018-07-14 15:19:09 +01:00
parent 84235900b2
commit 8ab5a87520
1 changed files with 5 additions and 2 deletions

View File

@ -249,10 +249,13 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
newSize.Height = 1024; newSize.Height = 1024;
} }
using(Bitmap resize = new Bitmap(image, newSize)) if(newSize.Width != image.Width || newSize.Height != image.Height)
{ {
imageJ2000 = OpenJPEG.EncodeFromImage(resize, false); using(Bitmap resize = new Bitmap(image, newSize))
imageJ2000 = OpenJPEG.EncodeFromImage(resize, false);
} }
else
imageJ2000 = OpenJPEG.EncodeFromImage(image, false);
} }
} }
catch (Exception) catch (Exception)