From ae13fec6553b00345666593f85e32d332cfed20d Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 6 Aug 2008 15:20:45 +0000 Subject: From: alan webb this adds image conversion features to the REST inventory/asset code. --- .../ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 5de2cb4..61c3ac4 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.IO; using System.Threading; using System.Xml; +using System.Drawing; using OpenJPEGNet; using OpenSim.Framework; using OpenSim.Framework.Servers; @@ -1931,8 +1932,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (ic.Item.AssetType == (int) AssetType.TextureTGA || ic.Item.AssetType == (int) AssetType.ImageTGA) { - // TODO: DO we need to convert it? Or is it enough to flag - // it appropriately? + Bitmap temp; + Stream tgadata = new MemoryStream(ic.Asset.Data); + + temp = OpenJPEGNet.LoadTGAClass.LoadTGA(tgadata); + ic.Asset.Data = OpenJPEGNet.OpenJPEG.EncodeFromImage(temp, true); } ic.reset(); -- cgit v1.1