@@ 460-466 (lines=7) @@ | ||
457 | // for an image that was uploaded before the custom image was added to the theme. Try to determine the size manually. |
|
458 | $image_meta = wp_get_attachment_metadata( $attachment_id ); |
|
459 | ||
460 | if ( isset( $image_meta['width'], $image_meta['height'] ) ) { |
|
461 | $image_resized = image_resize_dimensions( $image_meta['width'], $image_meta['height'], $image_args['width'], $image_args['height'], $image_args['crop'] ); |
|
462 | if ( $image_resized ) { // This could be false when the requested image size is larger than the full-size image. |
|
463 | $image_meta['width'] = $image_resized[6]; |
|
464 | $image_meta['height'] = $image_resized[7]; |
|
465 | } |
|
466 | } |
|
467 | } |
|
468 | ||
469 | if ( isset( $image_meta['width'], $image_meta['height'] ) ) { |
|
@@ 469-475 (lines=7) @@ | ||
466 | } |
|
467 | } |
|
468 | ||
469 | if ( isset( $image_meta['width'], $image_meta['height'] ) ) { |
|
470 | $image_args['width'] = $image_meta['width']; |
|
471 | $image_args['height'] = $image_meta['height']; |
|
472 | ||
473 | list( $image_args['width'], $image_args['height'] ) = image_constrain_size_for_editor( $image_args['width'], $image_args['height'], $size, 'display' ); |
|
474 | $has_size_meta = true; |
|
475 | } |
|
476 | ||
477 | // Expose determined arguments to a filter before passing to Photon |
|
478 | $transform = $image_args['crop'] ? 'resize' : 'fit'; |