Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#28152 closed defect (bug) (invalid)

image_resize_dimensions() function return false;

Reported by: alexvorn2's profile alexvorn2 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Media Keywords:
Focuses: Cc:

Description

Code I use:

$orig_w = 150;
$orig_h = 150;

$dest_w = 250;
$dest_h = 250;

$image_dim = image_resize_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );

var_dump( $image_dim );

Expected to have an array with variables but I get a bool false value in return.

Change History (4)

#1 @ocean90
10 years ago

  • Keywords close reporter-feedback added

From image_resize_dimensions():

// if the resulting image would be the same size or larger we don't want to resize it
if ( $new_w >= $orig_w && $new_h >= $orig_h )
    return false;

Why are you expecting an array?

Related: #19118

#2 @alexvorn2
10 years ago

  • Resolution set to invalid
  • Status changed from new to closed

First I thought that the function should return the same sizes if the values are bigger.

#3 @alexvorn2
10 years ago

  • Keywords close reporter-feedback removed

#4 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.