Code Duplication    Length = 10-14 lines in 2 locations

projects/plugins/jetpack/functions.opengraph.php 1 location

@@ 344-353 (lines=10) @@
341
					'height' => $height,
342
				)
343
			);
344
			if ( ! empty( $post_image ) && is_array( $post_image ) ) {
345
				$image['src'] = $post_image['src'];
346
				if ( isset( $post_image['src_width'], $post_image['src_height'] ) ) {
347
					$image['width']  = $post_image['src_width'];
348
					$image['height'] = $post_image['src_height'];
349
				}
350
				if ( ! empty( $post_image['alt_text'] ) ) {
351
					$image['alt_text'] = $post_image['alt_text'];
352
				}
353
			}
354
		}
355
	} elseif ( is_author() ) {
356
		$author = get_queried_object();

projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php 1 location

@@ 1343-1356 (lines=14) @@
1340
				}
1341
			}
1342
1343
			if ( ! empty( $img_url ) ) {
1344
				if ( ! empty( $post_image['alt_text'] ) ) {
1345
					$image_params['alt_text'] = $post_image['alt_text'];
1346
				} else {
1347
					$image_params['alt_text'] = '';
1348
				}
1349
				$image_params['width']  = $thumbnail_size['width'];
1350
				$image_params['height'] = $thumbnail_size['height'];
1351
				$image_params['src']    = Jetpack_PostImages::fit_image_url(
1352
					$img_url,
1353
					$thumbnail_size['width'],
1354
					$thumbnail_size['height']
1355
				);
1356
			}
1357
		}
1358
1359
		return $image_params;