Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#23987 closed feature request (worksforme)

add_image_size() shouldn't crop 0 values

Reported by: clorith's profile Clorith Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Media Keywords:
Focuses: Cc:


When using add_image_size() the image should only be cropped by values that are entered, the following example should only crop the height, and leave the width as the upload original;

add_image_size( 'wide-image', 0, 400, true );

If one uploads a 1600x1600 image, the above should then crop this to 1600x400.

Change History (2)

#1 in reply to: ↑ description @andg
10 years ago

Not really sure if that should even be a possibility, still if

the image should only be cropped by values that are entered

then 0 as a value for either the height or the width isn't really a good option in my opinion. Since we're basically willing to say "don't crop this dimension", boolean FALSE might be more appropriate.

#2 @markoheijnen
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

What andg says is correct. The current behavior is expected. The one you describe is more add_image_size( 'wide-image', 9999, 400, true ); .

Note: See TracTickets for help on using tickets.