Skip to content

Commit

Permalink
Merge pull request #38 from justcoded/feature/php7.4
Browse files Browse the repository at this point in the history
updating resize image function
  • Loading branch information
aprokopenko authored Nov 16, 2020
2 parents 35f7b5c + 2fbef3d commit 620e46b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions models/RwdImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,15 @@ public function dummy_source( $option, $retina_multiplier, $attachment_id, $meta
public function resize_image( $attach_id, $meta_data, $key, $width, $height, $crop ) {
$crop_str = ImageSize::crop_string( $crop );

$upload_dir = wp_get_upload_dir();
$image_baseurl = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . image_get_intermediate_size( $attach_id, $key )['path'];
$upload_dir = wp_get_upload_dir();
$intermediate_size = image_get_intermediate_size( $attach_id, $key );
$intermediate_path = '';

if ( ! empty( $intermediate_size ) ) {
$intermediate_path = $intermediate_size['path'];
}

$image_baseurl = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $intermediate_path;

$meta_data['sizes'][ $key ]['valid'] = true;

Expand Down

0 comments on commit 620e46b

Please sign in to comment.