WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 5 years ago

#18254 closed enhancement (worksforme)

Preserve image aspect ratio when editing dimensions manually in post editor

Reported by: voyagerfan5761 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Media Keywords: has-patch dev-feedback
Focuses: Cc:
PR Number:

Description

The dialog box that pops up when the user clicks the "edit image" icon that appears on hovering over an image in the visual editor has an "Advanced settings" tab with input fields for the pixel dimensions of the image.

When one is updated, the other does not change. A popular feature of image management software is to "link" the values and preserve the aspect ratio of the image.

I propose that WordPress have the option (a checkbox by the inputs?) to do this.

Sorry if this is terse; I'm about to be kicked off this library machine and I can't come back until tomorrow. Comment with anything I need to add and I'll update when I can.

Attachments (1)

18254.diff (5.1 KB) - added by asdasDan 8 years ago.

Download all attachments as: .zip

Change History (4)

@asdasDan
8 years ago

#1 @asdasDan
8 years ago

  • Keywords has-patch dev-feedback added

Added a patch, realized it may be odd because of not having the images added, but it essentially just puts a link/broken link next to the resizing feature of an image, when it's set to link it adds a css class of constrained, any height/width values entered will adjust the other to match the original images aspect ratio. When unlinked, the css class is removed, and either value can be modified freely as usual.

#2 @chriscct7
5 years ago

  • Component changed from Editor to Media

#3 @azaozz
5 years ago

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

Thanks @asdasDan for the patch but we went in a different direction. This is fixed in the new Edit Image modal we added when upgrading to TinyMCE 4.0. The image dimensions auto-adjust there.

Note: See TracTickets for help on using tickets.