Code Duplication    Length = 7-7 lines in 2 locations

class.photon.php 2 locations

@@ 474-480 (lines=7) @@
471
					// for an image that was uploaded before the custom image was added to the theme.  Try to determine the size manually.
472
					$image_meta = wp_get_attachment_metadata( $attachment_id );
473
474
					if ( isset( $image_meta['width'], $image_meta['height'] ) ) {
475
						$image_resized = image_resize_dimensions( $image_meta['width'], $image_meta['height'], $image_args['width'], $image_args['height'], $image_args['crop'] );
476
						if ( $image_resized ) { // This could be false when the requested image size is larger than the full-size image.
477
							$image_meta['width'] = $image_resized[6];
478
							$image_meta['height'] = $image_resized[7];
479
						}
480
					}
481
				}
482
483
				if ( isset( $image_meta['width'], $image_meta['height'] ) ) {
@@ 483-489 (lines=7) @@
480
					}
481
				}
482
483
				if ( isset( $image_meta['width'], $image_meta['height'] ) ) {
484
					$image_args['width']  = $image_meta['width'];
485
					$image_args['height'] = $image_meta['height'];
486
487
					list( $image_args['width'], $image_args['height'] ) = image_constrain_size_for_editor( $image_args['width'], $image_args['height'], $size, 'display' );
488
					$has_size_meta = true;
489
				}
490
491
				// Expose determined arguments to a filter before passing to Photon
492
				$transform = $image_args['crop'] ? 'resize' : 'fit';