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) --- .../World/WorldMap/TexturedMapTileRenderer.cs | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World') diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs index c5efb4f..d66bbdb 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs @@ -170,10 +170,31 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap ManagedImage managedImage; Image image; - if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) - return new Bitmap(image); - else - return null; + + try + { + if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) + return new Bitmap(image); + else + return null; + } + catch (DllNotFoundException) + { + m_log.ErrorFormat("[TexturedMapTileRenderer]: OpenJpeg is not installed correctly on this system. Asset Data is emtpy for {0}", id); + + } + catch (IndexOutOfRangeException) + { + m_log.ErrorFormat("[TexturedMapTileRenderer]: OpenJpeg was unable to encode this. Asset Data is emtpy for {0}", id); + + } + catch (Exception) + { + m_log.ErrorFormat("[TexturedMapTileRenderer]: OpenJpeg was unable to encode this. Asset Data is emtpy for {0}", id); + + } + return null; + } // Compute the average color of a texture. -- cgit v1.1