3 function getWidth(string) {
4 return (string.match(/width=\"([0-9]+)\"/))[1]
7 function getHeight(string) {
8 return (string.match(/height=\"([0-9]+)\"/))[1]
11 function getImagePath(string) {
12 var pattern = /src=\"http:\/\/(\S+)\"/
13 return (string.match(pattern))[1]
16 function calculateScale(width, height, cellSize) {
17 var widthScale = (cellSize * 1.0) / width
18 var heightScale = (cellSize * 1.0) / height
21 if (widthScale <= heightScale) {
23 } else if (heightScale < widthScale) {