WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6074 closed defect (bug) (fixed)

Intermediate image sizing, new thumbnails

Reported by: tellyworth Owned by:
Milestone: 2.5 Priority: highest omg bbq
Severity: blocker Version: 2.5
Component: General Keywords: media has-patch
Focuses: Cc:

Description

This improves the new image sizing features and implements new thumbnails.

Instead of a single thumbnail, images can now have multiple intermediate sizes. By default there's a Thumbnail size and a Medium size. These are generated at upload time and stored in the image metadata as a new array element 'sizes'. There's a hook so plugins can include additional sizes.

The new thumbnail size is 150x150, cropped to a square. The new design calls for 75x75 square thumbs; I decided on 150x150 because it's closer to the old size or 128x96, but can be scaled in the browser to half size without ugly artefacts.

get_attachment_thumb_url() and get_attachment_icon_src() will return the new thumbnail if it exists, and fall back to the old one if it does not.

Attachments (2)

intermediate-image-sizing-r7133-3.patch (14.3 KB) - added by tellyworth 7 years ago.
6074-2.diff (392 bytes) - added by andy 7 years ago.
image_downsize: Do not return attachment file URL as thumbnail if not an image

Download all attachments as: .zip

Change History (7)

comment:1 @tellyworth7 years ago

For best results apply the bugfix in #6073 first.

comment:2 @matt7 years ago

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

Fixed in [7135].

@andy7 years ago

image_downsize: Do not return attachment file URL as thumbnail if not an image

comment:3 @andy7 years ago

  • Keywords media has-patch added
  • Priority changed from normal to highest omg bbq
  • Resolution fixed deleted
  • Severity changed from normal to blocker
  • Status changed from closed to reopened
  • Type changed from enhancement to defect
  • Version set to 2.5

[7135] broke Media Library icons, returning the attachment file URL for as a thumbnail for non-images

comment:4 @ryan7 years ago

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

(In [7137]) Image sizing fix from andy. fixes #6074

comment:5 in reply to: ↑ description @KirkM7 years ago

Replying to tellyworth:

This improves the new image sizing features and implements new thumbnails.

Instead of a single thumbnail, images can now have multiple intermediate sizes. By default there's a Thumbnail size and a Medium size. These are generated at upload time and stored in the image metadata as a new array element 'sizes'. There's a hook so plugins can include additional sizes.

The new thumbnail size is 150x150, cropped to a square. The new design calls for 75x75 square thumbs; I decided on 150x150 because it's closer to the old size or 128x96, but can be scaled in the browser to half size without ugly artefacts.

get_attachment_thumb_url() and get_attachment_icon_src() will return the new thumbnail if it exists, and fall back to the old one if it does not.

Just took a look at the latest (03/03/08) 2.5 build. This above fix wouldn't have affected the "Media Library" at all would it? I just happened to notice that now all the thumbnail images in the Image Library are now appearing at what looks like their original size (rather huge). In yesterdays build (03/02/08) the thumbnails in the "Media Library" were fine.

Note: See TracTickets for help on using tickets.