client/js/libs/favico.js
function(imageElement) {
			_readyCb = function() {
				try {
					var w = imageElement.width;
					var h = imageElement.height;
					var newImg = document.createElement('img');
					var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
					newImg.setAttribute('src', imageElement.getAttribute('src'));
					newImg.height = (h / ratio);
					newImg.width = (w / ratio);
					_context.clearRect(0, 0, _w, _h);
					_context.drawImage(newImg, 0, 0, _w, _h);
					link.setIcon(_canvas);
				} catch(e) {
					throw 'Error setting image. Message: ' + e.message;
				}
			};
			if (_ready) {
				_readyCb();
			}
		}
function(imageElement) {
			_readyCb = function() {
				try {
					var w = imageElement.width;
					var h = imageElement.height;
					var newImg = document.createElement('img');
					var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
					newImg.setAttribute('src', imageElement.getAttribute('src'));
					newImg.height = (h / ratio);
					newImg.width = (w / ratio);
					_context.clearRect(0, 0, _w, _h);
					_context.drawImage(newImg, 0, 0, _w, _h);
					link.setIcon(_canvas);
				} catch(e) {
					throw 'Error setting image. Message: ' + e.message;
				}
			};
			if (_ready) {
				_readyCb();
			}
		}
function ( imageElement ) { _readyCb = function ( ) { try { var w = imageElement . width ; var h = imageElement . height ; var newImg = document . createElement ( 'img' ) ; var ratio = ( w / _w < h / _h ) ? ( w / _w ) : ( h / _h ) ; newImg . setAttribute ( 'src' , imageElement . getAttribute ( 'src' ) ) ; newImg . height = ( h / ratio ) ; newImg . width = ( w / ratio ) ; _context . clearRect ( 0 , 0 , _w , _h ) ; _context . drawImage ( newImg , 0 , 0 , _w , _h ) ; link . setIcon ( _canvas ) ; } catch ( e ) { throw 'Error setting image. Message: ' + e . message ; } } ; if ( _ready ) { _readyCb ( ) ; } }
Set image as icon
Set image as icon