If img is set to have the same width as the view, it will overflow vertically.
435280
function cropVertically( img ) {
  var zoom = this.width / img.width;
  var y = 0;
  if( this.cropping == 'body' ) {
    y = 0.5 * (this.height - img.height * zoom);
  }
  else if( this.cropping == 'tail' ) {
    y = this.height - img.height * zoom;
  }
  draw.call( this, img, 0, y, zoom );
}
1320836
function (element, overlay) {
            var geometry = aria.utils.Dom.getGeometry(element);
            var viewportSize = aria.utils.Dom.getViewportSize();
            var overlayGeometry = null;

            if (geometry) {
                var width1, width2, height1, height2;

                var overlayGeometryViewportRelative = {
                    x : Math.max(geometry.x, 0),
                    y : Math.max(geometry.y, 0)
                };
                if (overlay.style.position == "absolute") {
                    // geometry is relative to viewport
                    // overlayGeometry will be relative to the page!
                    var documentScroll = aria.utils.Dom._getDocumentScroll();
                    overlayGeometry = {
                        x : Math.max(geometry.x, 0) + documentScroll.scrollLeft,
                        y : Math.max(geometry.y, 0) + documentScroll.scrollTop
                    };
                } else { // fixed
                    // geometry is relative to viewport
                    // overlayGeometry will be relative to the viewport too
                    overlayGeometry = overlayGeometryViewportRelative;
                }

                // "cut-off" the overlay if the element stands out of the viewport to the left / top
                width1 = geometry.width + Math.min(geometry.x, 0);
                height1 = geometry.height + Math.min(geometry.y, 0);

                // "cut-off" the overlay if the element stands out of the viewport to the right / bottom
                width2 = viewportSize.width - overlayGeometryViewportRelative.x;
                height2 = viewportSize.height - overlayGeometryViewportRelative.y;

                overlayGeometry.width = Math.min(width1, width2);
                overlayGeometry.height = Math.min(height1, height2);
            }

            var style = overlay.style;
            // geometry may be null if the element is not currently visible
            if (overlayGeometry && overlayGeometry.height > 0 && overlayGeometry.width > 0) {
                style.top = overlayGeometry.y + "px";
                style.left = overlayGeometry.x + "px";
                style.width = overlayGeometry.width + "px";
                style.height = overlayGeometry.height + "px";
                style.display = "block";
                var browser = ariaCoreBrowser;
                if (browser.isIE && browser.majorVersion < 9 && overlay.firstChild) {
                    overlay.firstChild.style.top = Math.round(overlayGeometry.height / 2) + "px";
                }
            } else {
                style.display = "none";
            }
        }
428479
function() {
            if (this._shimActive) {
                YAHOO.log('Sizing Shim', 'info', 'DragDropMgr');
                var s = this._shim;
                s.style.height = Dom.getDocumentHeight() + 'px';
                s.style.width = Dom.getDocumentWidth() + 'px';
                s.style.top = '0';
                s.style.left = '0';
            }
        }
104729
function () {
                                /*
                                 var sizeResetWidth = observerElement[LEXICON.oW] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
                                 var sizeResetHeight = observerElement[LEXICON.oH] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
                                 var expandChildCSS = {};
                                 expandChildCSS[_strWidth] = sizeResetWidth;
                                 expandChildCSS[_strHeight] = sizeResetHeight;
                                 expandElementChild.css(expandChildCSS);


                                 expandElement[_strScrollLeft](sizeResetWidth)[_strScrollTop](sizeResetHeight);
                                 shrinkElement[_strScrollLeft](sizeResetWidth)[_strScrollTop](sizeResetHeight);
                                 */
                                expandElement[_strScrollLeft](constMaximum)[_strScrollTop](constMaximum);
                                shrinkElement[_strScrollLeft](constMaximum)[_strScrollTop](constMaximum);
                            }
387368
function(){
		var viewWidth=$("#svgroot").attr("width");
		var viewHeight=$("#svgroot").attr("height");
		var viewX=640;
		var viewY=480;
		
		if(svgedit.browser.isIE())
		{
			//This has only been tested with Firefox 10 and IE 9 (without chrome frame).
			//I am not sure if if is Firefox or IE that is being non compliant here.
			//Either way the one that is noncompliant may become more compliant later.
			//TAG:HACK  
			//TAG:VERSION_DEPENDENT
			//TAG:BROWSER_SNIFFING
			viewX=0;
			viewY=0;
		}
		
		var svgWidth_old=$("#overviewMiniView").attr("width");
		var svgHeight_new=viewHeight/viewWidth*svgWidth_old;
		$("#overviewMiniView").attr("viewBox",viewX+" "+viewY+" "+viewWidth+" "+viewHeight);
		$("#overviewMiniView").attr("height",svgHeight_new);
		updateViewBox();
	}
1245711
function( width, height ) {
		if( arguments.length === 2 ) {
			this.width = width;
			this.height = height;
		} else {
			this.width = this.container.width();
			this.height = this.container.height();
		}

		if( this.isInitialised === true ) {
			this.root.callDownwards( 'setSize' );
		}
	}
949435
private void checkDeclareAlg(GrayF32 image) {
		if( prevWidth != image.width || prevHeight != image.height ) {
			prevWidth = image.width;
			prevHeight = image.height;
			alg = new GeneralPurposeFFT_F32_2D(image.height,image.width);
		}
	}
138776
function setDivTag(image, img) {
  var setElemStyle = DOM.setStyle(image.element);
  setElemStyle('backgroundImage', 'url(' + img.src + ')');

  if (image.preserveAspectRatio) {
    var w, h;

    if (image.knownDimensions) {
      w = image.knownDimensions[0];
      h = image.knownDimensions[1];
    } else {
      w = img.width;
      h = img.height;
    }

    setElemStyle('backgroundSize', 'cover');

    if (image.isFlexible) {
      setElemStyle('paddingBottom', ((h / w) * 100.0) + '%');
    } else {
      setElemStyle('width', w + 'px');
      setElemStyle('height', h + 'px');
    }
  }
}
45984
def resize(img, width, height):
    
    return img.resize((width, height), Image.ANTIALIAS)
399046
function($container) {
    var styles = window.getComputedStyle($container, null);
    var position = styles.getPropertyValue("position");
    var overflow = styles.getPropertyValue("overflow");
    var display = styles.getPropertyValue("display");

    if (!position || position === "static") {
      $container.style.position = "relative";
    }
    if (overflow !== "hidden") {
      $container.style.overflow = "hidden";
    }
    // Guesstimating that people want the parent to act like full width/height wrapper here.
    // Mostly attempts to target <picture> elements, which default to inline.
    if (!display || display === "inline") {
      $container.style.display = "block";
    }
    if ($container.clientHeight === 0) {
      $container.style.height = "100%";
    }

    // Add a CSS class hook, in case people need to override styles for any reason.
    if ($container.className.indexOf("object-fit-polyfill") === -1) {
      $container.className = $container.className + " object-fit-polyfill";
    }
  }
451786
function () {

            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
                elementWidth = this.element.offsetWidth,
                elementHeight = this.element.offsetHeight,
                viewPortWidth = Dom.getViewportWidth(),
                viewPortHeight = Dom.getViewportHeight(),
                x,
                y;

            if (elementWidth < viewPortWidth) {
                x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft();
            } else {
                x = nViewportOffset + Dom.getDocumentScrollLeft();
            }

            if (elementHeight < viewPortHeight) {
                y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop();
            } else {
                y = nViewportOffset + Dom.getDocumentScrollTop();
            }

            this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
            this.cfg.refireEvent("iframe");

            if (UA.webkit) {
                this.forceContainerRedraw();
            }
        }
1044786
function () {
			var that = this;

			this.$el.on('mouseenter', '.mediumInsert-images', function () {
				var $img = $('img', this),
						positionTop,
						positionLeft;

				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				if ($img.length > 0) {
					$(this).append('<a class="mediumInsert-imageRemove"></a>');

					if ($(this).parent().parent().hasClass('small')) {
						$(this).append('<a class="mediumInsert-imageResizeBigger"></a>');
					} else {
						$(this).append('<a class="mediumInsert-imageResizeSmaller"></a>');
					}

					positionTop = $img.position().top + parseInt($img.css('margin-top'), 10);
					positionLeft = $img.position().left + $img.width() -30;
					$('.mediumInsert-imageRemove', this).css({
						'right': 'auto',
						'top': positionTop,
						'left': positionLeft
					});
					$('.mediumInsert-imageResizeBigger, .mediumInsert-imageResizeSmaller', this).css({
						'right': 'auto',
						'top': positionTop,
						'left': positionLeft-31
					});
				}
			});

			this.$el.on('mouseleave', '.mediumInsert-images', function () {
				$('.mediumInsert-imageRemove, .mediumInsert-imageResizeSmaller, .mediumInsert-imageResizeBigger', this).remove();
			});

			this.$el.on('click', '.mediumInsert-imageResizeSmaller', function () {
				$(this).parent().parent().parent().addClass('small');
				$(this).parent().mouseleave().mouseleave();

				$.fn.mediumInsert.insert.deselect();
				that.$el.trigger('keyup').trigger('input');
			});

			this.$el.on('click', '.mediumInsert-imageResizeBigger', function () {
				$(this).parent().parent().parent().removeClass('small');
				$(this).parent().mouseleave().mouseleave();

				$.fn.mediumInsert.insert.deselect();
				that.$el.trigger('keyup').trigger('input');
			});

			this.$el.on('click', '.mediumInsert-imageRemove', function () {
				var img = $(this).siblings('img').attr('src');

				if ($(this).parent().siblings().length === 0) {
					$(this).parent().parent().parent().removeClass('small');
				}
				$(this).parent().remove();

				that.deleteFile(img, that);

				$.fn.mediumInsert.insert.deselect();

				that.$el.trigger('keyup').trigger('input');
			});
		}
102517
function (src, x, y, width, height) {
		var obj = this.createElement('img')
			.attr({ src: src });

		if (arguments.length > 1) {
			obj.attr({
				x: x,
				y: y,
				width: width,
				height: height
			});
		}
		return obj;
	}
266809
function() {
        canvasWidth = $(window).width();
        canvasHeight = $(window).height();
        if (supportsCanvas) {
          $canvas[0].width = canvasWidth;
          $canvas[0].height = canvasHeight;
        }
        $container.width(canvasWidth);
        $container.height(canvasHeight);
      }
1360086
def fix(self, with_margin=True):
        """"""
        if not self.width:
            self.xmax = self.xmin + 1
        if not self.height:
            self.ymin /= 2
            self.ymax += self.ymin
        xmargin = self.margin * self.width
        self.xmin -= xmargin
        self.xmax += xmargin
        if with_margin:
            ymargin = self.margin * self.height
            self.ymin -= ymargin
            self.ymax += ymargin
237793
function(width, height) {
        var gutter = (this.options.gutter * 2),
            wWidth = $(window).width() - gutter,
            wHeight = $(window).height() - gutter,
            ratio,
            diff;

        // Resize if the width is larger
        if (width > wWidth) {
            ratio = (width / height);
            diff = (width - wWidth);

            width = wWidth;
            height -= Math.round(diff / ratio);
        }

        // Resize again if the height is larger
        if (height > wHeight) {
            ratio = (height / width);
            diff = (height - wHeight);

            width -= Math.round(diff / ratio);
            height = wHeight;
        }

        this.items.css({
            width: width,
            height: height
        });
    }
853732
function flip( $mode )
	{
		$width = $this->width;
		$height = $this->height;

		$src_x = 0;
		$src_y = 0;
		$src_width = $width;
		$src_height = $height;

		switch ( $mode )
		{
			case 'vertical':
				$src_y = $height -1;
				$src_height = -$height;
			break;

			case 'horizontal': 
				$src_x = $width -1;
				$src_width = -$width;
			break;

			case 'both':
				$src_x = $width -1;
				$src_y = $height -1;
				$src_width = -$width;
				$src_height = -$height;
			break;
		}

		$imgdest = imagecreatetruecolor( $width, $height );

		if ( imagecopyresampled( $imgdest, $this->image_context, 0, 0, $src_x, $src_y , $width, $height, $src_width, $src_height ) )
		{
			$this->image_context = $imgdest;
		}

		return $this->image_context;

	}