Code Duplication    Length = 4-4 lines in 4 locations

lib/private/image.php 4 locations

@@ 774-777 (lines=4) @@
771
	 * @return bool
772
	 */
773
	public function resize($maxSize) {
774
		if (!$this->valid()) {
775
			$this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
776
			return false;
777
		}
778
		$widthOrig = imageSX($this->resource);
779
		$heightOrig = imageSY($this->resource);
780
		$ratioOrig = $widthOrig / $heightOrig;
@@ 800-803 (lines=4) @@
797
	 * @return bool
798
	 */
799
	public function preciseResize($width, $height) {
800
		if (!$this->valid()) {
801
			$this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
802
			return false;
803
		}
804
		$widthOrig = imageSX($this->resource);
805
		$heightOrig = imageSY($this->resource);
806
		$process = imagecreatetruecolor($width, $height);
@@ 900-903 (lines=4) @@
897
	 * @return bool for success or failure
898
	 */
899
	public function crop($x, $y, $w, $h) {
900
		if (!$this->valid()) {
901
			$this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
902
			return false;
903
		}
904
		$process = imagecreatetruecolor($w, $h);
905
		if ($process == false) {
906
			$this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
@@ 937-940 (lines=4) @@
934
	 * @return bool
935
	 */
936
	public function fitIn($maxWidth, $maxHeight) {
937
		if (!$this->valid()) {
938
			$this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
939
			return false;
940
		}
941
		$widthOrig = imageSX($this->resource);
942
		$heightOrig = imageSY($this->resource);
943
		$ratio = $widthOrig / $heightOrig;