If texture decode fails in Warp3D map maker, log uuid of asset that failed to decode along with exception

0.8.0.3
Justin Clark-Casey (justincc) 2014-02-20 23:36:50 +00:00
parent d50d169441
commit 11b4f534c2
1 changed files with 14 additions and 1 deletions

View File

@ -631,16 +631,29 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
private warp_Texture GetTexture(UUID id)
{
warp_Texture ret = null;
byte[] asset = m_scene.AssetService.GetData(id.ToString());
if (asset != null)
{
IJ2KDecoder imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder>();
Bitmap img = (Bitmap) imgDecoder.DecodeToImage(asset);
Bitmap img = null;
try
{
img = (Bitmap)imgDecoder.DecodeToImage(asset);
}
catch (Exception e)
{
m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e);
}
if (img != null)
{
return new warp_Texture(img);
}
}
return ret;
}