Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#5933 closed enhancement (fixed)

Image size options

Reported by: tellyworth Owned by: ryan
Milestone: 2.5 Priority: high
Severity: normal Version:
Component: General Keywords: has-patch media
Focuses: Cc:


This adds some image size options and scaling features. The single image upload form now has a Size option with three choices: Thumbnail, Medium and Full Size. Selecting Thumbnail or Medium will automatically add a link to the attachment page if a URL is not specified by the user; Full Size includes no link unless one is specified. The dimensions for thumbnails and medium sized images can be set on the Options/Writing tab.

The images aren't actually resized (yet); browser scaling is used to fit the image within the specified dimensions. There's a filter hook that could be used to create and cache an intermediate sized image file to save bandwidth.

I've also moved some general image functions out of media.php and into a new wp-includes/image.php file. There's still some work that needs to be done in consolidating the single and multi upload forms and code.

Attachments (2)

image-size-options-r6937.patch (12.6 KB) - added by tellyworth 8 years ago.
image-size-options-2-r6947.patch (12.6 KB) - added by tellyworth 8 years ago.
rename wp-includes/image.php to media.php

Download all attachments as: .zip

Change History (6)

#1 @tellyworth
8 years ago

Unit tests for some of the image functions are here:


More are on the way.

8 years ago

rename wp-includes/image.php to media.php

#2 @tellyworth
8 years ago

The second patch is the same code but with image.php renamed to media.php, as suggested by Andy.

#3 @andy
8 years ago

  • Keywords media added
  • Owner changed from anonymous to ryan
  • Priority changed from normal to high

#4 @ryan
8 years ago

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

(In [6952]) Image size options from tellyworth. fixes #5933

Note: See TracTickets for help on using tickets.