Code Duplication    Length = 5-5 lines in 2 locations

engine/lib/filestore.php 1 location

@@ 285-289 (lines=5) @@
282
		$new_height = $maxheight;
283
284
		// maintain aspect ratio of original image/crop
285
		if (($selection_height / (float)$new_height) > ($selection_width / (float)$new_width)) {
286
			$new_width = floor($new_height * $selection_width / (float)$selection_height);
287
		} else {
288
			$new_height = floor($new_width * $selection_height / (float)$selection_width);
289
		}
290
291
		// by default, use entire image
292
		$widthoffset = 0;

mod/tidypics/lib/resize.php 1 location

@@ 533-537 (lines=5) @@
530
		// non-square new image
531
532
		// maintain aspect ratio of original image/crop
533
		if (($region_height / (float)$new_height) > ($region_width / (float)$new_width)) {
534
			$new_width = floor($new_height * $region_width / (float)$region_height);
535
		} else {
536
			$new_height = floor($new_width * $region_height / (float)$region_width);
537
		}
538
539
		// by default, use entire image
540
		$widthoffset = 0;