Remember to dispose of the bitmap opened from a file in GatekeeperServiceConnector.GetMapImage()
parent
63cda3a6d0
commit
4ac2f839bd
|
@ -154,7 +154,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
|
|
||||||
UUID mapTile = m_HGMapImage;
|
UUID mapTile = m_HGMapImage;
|
||||||
string filename = string.Empty;
|
string filename = string.Empty;
|
||||||
Bitmap bitmap = null;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WebClient c = new WebClient();
|
WebClient c = new WebClient();
|
||||||
|
@ -167,11 +167,18 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
c.DownloadFile(imageURL, filename);
|
c.DownloadFile(imageURL, filename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image");
|
m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image");
|
||||||
|
}
|
||||||
|
|
||||||
bitmap = new Bitmap(filename);
|
byte[] imageData = null;
|
||||||
|
|
||||||
|
using (Bitmap bitmap = new Bitmap(filename))
|
||||||
|
{
|
||||||
//m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
|
//m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
|
||||||
byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true);
|
imageData = OpenJPEG.EncodeFromImage(bitmap, true);
|
||||||
|
}
|
||||||
|
|
||||||
AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
|
AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
|
||||||
|
|
||||||
// !!! for now
|
// !!! for now
|
||||||
|
|
Loading…
Reference in New Issue