From 1a55dd11f1e0c17452c3264ff02496d8ced8a421 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 21 Jan 2009 11:16:33 +0000 Subject: * More friendly OpenJpeg error handling. * Often times now the only reason OpenJpeg doesn't work is because it requires Glibc 2.4 The error messages reflect that. * In J2kDecoder module, It stops trying to decode modules if it encounters a dllnotfound exception and instead sends a full resolution layer that causes the texture sender to only send the full resolution image. (big decrease in texture download speed, but it's better then nasty repeating error messages) --- .../Rest/Inventory/RestInventoryServices.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 913eb0c..2dce706 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -2136,7 +2136,25 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Stream tgadata = new MemoryStream(ic.Asset.Data); temp = LoadTGAClass.LoadTGA(tgadata); - ic.Asset.Data = OpenJPEG.EncodeFromImage(temp, true); + try + { + ic.Asset.Data = OpenJPEG.EncodeFromImage(temp, true); + } + catch (DllNotFoundException) + { + Rest.Log.ErrorFormat("OpenJpeg is not installed correctly on this system. Asset Data is emtpy for {0}", ic.Item.Name); + ic.Asset.Data = new Byte[0]; + } + catch (IndexOutOfRangeException) + { + Rest.Log.ErrorFormat("OpenJpeg was unable to encode this. Asset Data is emtpy for {0}", ic.Item.Name); + ic.Asset.Data = new Byte[0]; + } + catch (Exception) + { + Rest.Log.ErrorFormat("OpenJpeg was unable to encode this. Asset Data is emtpy for {0}", ic.Item.Name); + ic.Asset.Data = new Byte[0]; + } } ic.reset(); -- cgit v1.1