Index: src/wmsplugin/WMSLayer.java
===================================================================
--- src/wmsplugin/WMSLayer.java	(revision 10666)
+++ src/wmsplugin/WMSLayer.java	(working copy)
@@ -52,7 +52,7 @@
 
 	public int messageNum = 5; //limit for messages per layer
 	protected boolean stopAfterPaint = false;
-	protected int ImageSize = 500;
+	protected int ImageSize = 1000;
 	protected int dax = 10;
 	protected int day = 10;
 	protected int minZoom = 3;
Index: src/wmsplugin/YAHOOGrabber.java
===================================================================
--- src/wmsplugin/YAHOOGrabber.java	(revision 10666)
+++ src/wmsplugin/YAHOOGrabber.java	(working copy)
@@ -61,7 +61,7 @@
 
 	public void run() {
 			Image img;
-			
+
 			width = (int) ((b.max.lon() - b.min.lon()) * pixelPerDegree);
 			height = (int) ((b.max.lat() - b.min.lat()) * pixelPerDegree);
 
@@ -80,7 +80,8 @@
 					}
 					Process browser = browse(url.toString());;
 					image.image =  new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-					img = ImageIO.read(browser.getInputStream()).getScaledInstance(width, height, Image.SCALE_FAST);
+					img = grab(browser, width, height,
+							b.max.lat());
 				}
 				image.image.getGraphics().drawImage(img, 0 , 0, null);
 
@@ -102,7 +103,30 @@
 			}
 	}
 
+	static protected Image grab(Process browser, int width, int height,
+			double lat) throws IOException {
+		BufferedImage img;
+		double ratio;
 
+		/*
+		 * Calculate the pixel aspect ratio:
+		 * 1 deg lon in meters / 1 deg lat in meters.
+		 * (should multiply by 40075.02 / 40007.86 - equatorial
+		 * to meridional circumference, but don't know if Yahoo!
+		 * takes that into account)
+		 */
+		ratio = Math.cos(Math.toRadians(lat));
+		/*
+		 * gnome-web-photo + gecko gives us an image with height
+		 * matching the picture's height and width of some broswer
+		 * default value, with the image aligned to left.
+		 */
+		img = ImageIO.read(browser.getInputStream());
+		width = (int)
+			(img.getWidth() * width / ratio / img.getHeight()) + 1;
+		return img.getScaledInstance(width, height, Image.SCALE_SMOOTH);
+	}
+
 	protected Process browse(String url) throws IOException {
 		ArrayList<String> cmdParams = new ArrayList<String>();
 		
Index: resources/ymap.html
===================================================================
--- resources/ymap.html	(revision 10666)
+++ resources/ymap.html	(working copy)
@@ -1,10 +1,6 @@
 <html>
   <head>
     <script type="text/javascript">
-		//var bbox = "";
-        //var width  = 800;
-        //var height = 800;
-
 		// Parse query string and set variables
 		var url = location.href;
         var queryStringPos = url.indexOf("?");
@@ -12,7 +8,7 @@
         {
             url = url.substring(queryStringPos + 1);
 	    	var variables = url.split ("&");
-            for (i = 0; i < variables.length; i++) 
+            for (i = 0; i < variables.length; i++)
             {
             	if( !variables[i] )
             		continue;
@@ -24,15 +20,10 @@
         {
             dump("YWMS ERROR: no queryString\n");
         }
-        
-        // Limit size to current window's, to avoid memory problems
-        //width = Math.min(width, screen.width);
-        //height = Math.min(height, screen.height);
-        
     </script>
     <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=z7qRk3_V34HAbY_SkC7u7GAgG5nDTblw.cuL1OS5LWGwkIIUeGjg4qsnJDPpmhoF"></script>
   </head>
-  
+
   <body style="margin: 0px">
     <div id="map"></div>
     <script type="text/javascript">
@@ -59,7 +50,7 @@
         map.removeZoomScale();
         var zac = map.getBestZoomAndCenter(points);
         var level = zac.zoomLevel;
-         
+
         // funny Yahoo bug seems to return 0 if your section is too small
         if( level == 0 ) level = 1;
         if (level>1) level--;
@@ -73,34 +64,17 @@
         // This is hack to bug in getBestZoomAndCenter function
         cx = map.convertXYLatLon(new YCoordPoint((xy0.x+xy1.x)/2, (xy0.y+xy1.y)/2));
         map.drawZoomAndCenter(cx,level)
-      
-        dump(xy0.x + " " + xy0.y + " " + xy1.x + " " + xy1.y + "\n");
-        dump(tllat + " " + tllon + " " + brlat + " " + brlon + "\n");
-        dump((brlat + tllat)/2 + " " + (brlon + tllon)/2 + "\n");
-        
+
         // Create a new size for the map. This makes the need of clipping the image unnecessary.
-        new_width  = Math.abs( xy0.x - xy1.x);
-        new_height = Math.abs( xy0.y - xy1.y);
-        
+        new_width  = Math.abs(xy0.x - xy1.x);
+        new_height = Math.abs(xy0.y - xy1.y);
+
         // Apply the new width-height
         mapDiv.style.width  = new_width;
         mapDiv.style.height = new_height;
-        map.resizeTo( new YSize(new_width, new_height));
-        window.moveTo(0,0);
+        map.resizeTo(new YSize(new_width, new_height));
+        window.moveTo(0, 0);
         window.resizeTo(new_width, new_height);
-
-
-          
-        /*
-        /// DEBUG: colour the interesting area
-        var cPT2 = new YGeoPoint(tllat, tllon); 
-        var cPT3 = new YGeoPoint(tllat, brlon); 
-        var cPT4 = new YGeoPoint(brlat, brlon); 
-        var cPT5 = new YGeoPoint(brlat, tllon); 
-        // args: array of pts, color, width, alpha 
-        var poly1 = new YPolyline([cPT2,cPT3,cPT4,cPT5, cPT2],'blue',7,0.7); 
-        map.addOverlay(poly1);
-        */
       }
     </script>
   </body>
