WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5777 closed enhancement (fixed)

Constrain image size when adding to editor

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

Description

Currently, if you upload a very large image and send it to the visual editor with the Add Image button, it's difficult to scale it down without a lot of scrolling.

This patch will scale the image down with image width and height if it exceeds a certain size on its longest side. The size defaults to $content_width if it is set in the current theme's functions.php, or 500 pixels otherwise. Smaller images are not scaled up.

Filters are available for plugins to override the max width and height constraints. I also added a filter in image_send_to_editor() so the entire img tag markup can be altered if necessary, as suggested here: http://trac.wordpress.org/ticket/5609#comment:5

Attachments (1)

image-editor-constrain-size-r6736.patch (1.9 KB) - added by tellyworth 6 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 ryan6 years ago

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

(In [6747]) Constrain image size when adding to editor. Props tellyworth. fixes #5777

comment:2 AaronCampbell6 years ago

Just stating my opinion that it should be resized to $content_width or NOT RESIZED. What's the point of calling it "full size" and then not making it "full size"

If we want small medium large, lets call it that, but lets also keep full size.

Note: See TracTickets for help on using tickets.