WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 5 weeks ago

#42463 assigned defect (bug)

Poor Description of add_image_size Params

Reported by: miqrogroove Owned by: nikolastoqnow
Milestone: 5.0 Priority: normal
Severity: normal Version: 3.9
Component: Media Keywords: has-patch
Focuses: docs Cc:

Description

From https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/media.php#L274

274	 * @param bool|array $crop   Optional. Whether to crop images to specified width and height or resize.
275	 *                           An array can specify positioning of the crop area. Default false.

So it literally says to do one thing or another. But which is what? "Default false" has a meaning, but it is totally lost in this documentation.

Attachments (3)

42463.diff (1009 bytes) - added by nikolastoqnow 5 weeks ago.
Add better description about crop parameter in add_image_size function
42463.patch (974 bytes) - added by ketuchetan 5 weeks ago.
42463.2.patch (971 bytes) - added by ketuchetan 5 weeks ago.

Download all attachments as: .zip

Change History (7)

@nikolastoqnow
5 weeks ago

Add better description about crop parameter in add_image_size function

#1 @nikolastoqnow
5 weeks ago

  • Keywords has-patch added; needs-patch removed

#2 @ocean90
5 weeks ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 5.0
  • Owner set to nikolastoqnow
  • Status changed from new to assigned
  • Version changed from trunk to 3.9

Introduced in [27472].

@nikolastoqnow Thanks for your patch! Looks like an empty line slipped into the patch. The use of "we" should also be avoided.

@ketuchetan
5 weeks ago

#3 @ketuchetan
5 weeks ago

  • Keywords good-first-bug needs-refresh removed

Hi @ocean90 ,

I have made the changes as you requested in @nikolastoqnow patch.

Please let me know if any changes on that.

Thanks,
Chetan

@ketuchetan
5 weeks ago

#4 @miqrogroove
5 weeks ago

How about adding something to the effect of:

  • Resize to fit one dimension, then crop image to fit the other dimension.
  • Keep source aspect and resize to fit both dimensions, allowing one dimension to become smaller than specified.

This is roughly how I would describe the two different outcomes. And assign them to "true" and "false".

Note: See TracTickets for help on using tickets.