Code Duplication    Length = 9-9 lines in 2 locations

filesystem/GD.php 1 location

@@ 414-422 (lines=9) @@
411
		$widthRatio = $maxWidth / $this->width;
412
		$heightRatio = $maxHeight / $this->height;
413
414
		if( $widthRatio < $heightRatio )
415
			return $useAsMinimum ? $this->resizeByHeight( $maxHeight ) : $this->resizeByWidth( $maxWidth );
416
		else
417
			return $useAsMinimum ? $this->resizeByWidth( $maxWidth ) : $this->resizeByHeight( $maxHeight );
418
	}
419
420
	public static function color_web2gd($image, $webColor) {
421
		if(substr($webColor,0,1) == "#") $webColor = substr($webColor,1);
422
		$r = hexdec(substr($webColor,0,2));
423
		$g = hexdec(substr($webColor,2,2));
424
		$b = hexdec(substr($webColor,4,2));
425

filesystem/ImagickBackend.php 1 location

@@ 156-164 (lines=9) @@
153
		$widthRatio = $maxWidth / $geometry["width"];
154
		$heightRatio = $maxHeight / $geometry["height"];
155
156
		if( $widthRatio < $heightRatio )
157
			return $useAsMinimum ? $this->resizeByHeight( $maxHeight ) : $this->resizeByWidth( $maxWidth );
158
		else
159
			return $useAsMinimum ? $this->resizeByWidth( $maxWidth ) : $this->resizeByHeight( $maxHeight );
160
	}
161
162
	/**
163
	 * resizeByWidth
164
	 *
165
	 * @param int $width
166
	 * @return Image_Backend
167
	 */