aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorMelanie2012-04-20 16:48:43 +0100
committerMelanie2012-04-20 16:48:43 +0100
commit464fb2533f29c98cba27d7a99529e49c8c108d7d (patch)
tree233543c1aee30a17352028489b92ac350969a2b2 /OpenSim/Services/Connectors
parentMerge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into ... (diff)
parentAlways dispose of existing opened bitmap from file in SaveFile(), instead of ... (diff)
downloadopensim-SC_OLD-464fb2533f29c98cba27d7a99529e49c8c108d7d.zip
opensim-SC_OLD-464fb2533f29c98cba27d7a99529e49c8c108d7d.tar.gz
opensim-SC_OLD-464fb2533f29c98cba27d7a99529e49c8c108d7d.tar.bz2
opensim-SC_OLD-464fb2533f29c98cba27d7a99529e49c8c108d7d.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs OpenSim/Region/ScriptEngine/XEngine/XEngine.cs OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs25
1 files changed, 20 insertions, 5 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index bc0bc54..4cd933c 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -154,17 +154,32 @@ namespace OpenSim.Services.Connectors.Hypergrid
154 154
155 UUID mapTile = m_HGMapImage; 155 UUID mapTile = m_HGMapImage;
156 string filename = string.Empty; 156 string filename = string.Empty;
157 Bitmap bitmap = null; 157
158 try 158 try
159 { 159 {
160 WebClient c = new WebClient(); 160 WebClient c = new WebClient();
161 //m_log.Debug("JPEG: " + imageURL); 161 //m_log.Debug("JPEG: " + imageURL);
162 string name = regionID.ToString(); 162 string name = regionID.ToString();
163 filename = Path.Combine(storagePath, name + ".jpg"); 163 filename = Path.Combine(storagePath, name + ".jpg");
164 c.DownloadFile(imageURL, filename); 164 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename);
165 bitmap = new Bitmap(filename); 165 if (!File.Exists(filename))
166 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 166 {
167 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); 167 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading...");
168 c.DownloadFile(imageURL, filename);
169 }
170 else
171 {
172 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image");
173 }
174
175 byte[] imageData = null;
176
177 using (Bitmap bitmap = new Bitmap(filename))
178 {
179 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
180 imageData = OpenJPEG.EncodeFromImage(bitmap, true);
181 }
182
168 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString()); 183 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
169 184
170 // !!! for now 185 // !!! for now