Problem/Motivation

During the usability study, many participants were confused by the image width and height inputs when embedding an image through CKeditor. They thought they needed to supply this information.

I would think that the width and height should be automatically filled when I upload the image

The height/width inputs output directly to the width and height attributes of the image tag. This don't resize or crop the image, it just sets a visual size. It's also problematic for responsive themes, as the CSS styling usually overrides this setting so it can display correctly on different screen sizes. At best these values lie to the user, as a theme can override them. At worst, they allow content creator to break the look and feel of the site.

Proposed resolution

Remove the fields from the settings form. They are outdated and rarely used. Lewis and Marc Drummond spoke about this at the TCDC sprints, and he agreed it was more problematic to leave them in. He also suggested we add an image style selector in 8.1.

Remaining tasks

Agree to remove these inputs
Patch
Test

User interface changes

Removing the width and height form inputs for CKeditor image embeds

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuaelFr’s picture

I had the same questions from a lot of users.
They often don't understand at all what's the difference between resizing the picture offline to optimize it's size and resizing the picture using these inputs. They are also confused by the fact that Drupal resizes images in dedicated fields but not in the editor.

It would be really fantastic to be able to select an image style (or even a responsive image style) in this dialog.

tkoleary’s picture

@DuaelFr

It would be really fantastic to be able to select an image style (or even a responsive image style) in this dialog.

You took the words right out of my mouth. Wim Leers and I have actually already discussed something similar to this. The problem, I *think*, is that the image styles can only be applied to image fields. That can be done in D8 by installing entity embed module but that puts this squarely in contrib for the forseeable future.

mErilainen’s picture

Status: Active » Needs review
FileSize
1.72 KB

This patch will simply remove the fieldset and the dimension fields from the image upload dialog.

LewisNyman’s picture

Assigned: Unassigned » Wim Leers
Issue summary: View changes
Issue tags: +Needs subsystem maintainer review
FileSize
381.8 KB

Great, this works as expected, assuming the tests pass. As we're removing functionality I'm assigning to Wim for the final review.

Wim Leers’s picture

Title: Remove the width/height inputs from image embed » Remove the width/height inputs from EditorImageDialog
Component: ckeditor.module » editor.module
Issue tags: +Needs usability review
Related issues: +#2061377: [drupalImage] Optionally apply image style to images uploaded in CKEditor 5

Remove the fields from the settings form. They are outdated and rarely used. Lewis and Marc Drummond spoke about this at the TCDC sprints, and he agreed it was more problematic to leave them in. He also suggested we add an image style selector in 8.1.

I'm personally completely in favor of this. And we're already working on the latter in #2061377: [drupalImage] Optionally apply image style to images uploaded in CKEditor 5. But, until we have that… what if a user uploads a multi-megapixel image? It'll then be enormous. In other words: we're expecting people to upload images of a sane size.

Are we sure that that really is a better trade-off?

DuaelFr’s picture

IMHO, not allowing users to set the widht and height in the dialog is better because if they upload an huge image, they'll see it immediately while (pre)viewing their content. I think that's a lot better than letting them think the image has been properly scaled down - what's clearly not the case with the current behavior. We might keep in mind that most of the writers dont know anything about HTML and have no idea about how the <img> tag really works.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs subsystem maintainer review, -Needs usability review
Related issues: +#2395377: Write integration test for EditorImageDialog

IMHO, not allowing users to set the widht and height in the dialog is better because if they upload an huge image, they'll see it immediately while (pre)viewing their content. I think that's a lot better than letting them think the image has been properly scaled down - what's clearly not the case with the current behavior. We might keep in mind that most of the writers dont know anything about HTML and have no idea about how the <img> tag really works.

That makes a ton of sense!

You're absolutely right. Until we have #2061377: [drupalImage] Optionally apply image style to images uploaded in CKEditor 5, the behavior proposed in this patch makes more sense. You've convinced me :)

Considerations:

Therefore, this is ready. I manually tested it, and it works fine.

Wim Leers’s picture

Assigned: Wim Leers » Unassigned
tkoleary’s picture

While we're at it maybe we can get rid of the align stuff too. ;)

Wim Leers’s picture

While we're at it maybe we can get rid of the align stuff too. ;)

  1. Out of scope. Especially because that was not raised as something unusable in the UMN 2015 study.
  2. That's still relevant ;)

Let's not broaden the scope and then get stuck.

kattekrab’s picture

Hmmm I tend to agree with removing the width & height fields here.

Along with @DuaelFr's excellent point about it not actually scaling the image, it's too easy to get them wrong, and distort the image.

But I disagree with @tkoleary about removing the alignment field - I find that really really useful. Unless there's another, easier way to set images left, right or centre, then I don't see why we would consider removing that.

I'm firing up SimplyTest me for a manual review now.

kattekrab’s picture

Issue summary: View changes
FileSize
22.17 KB
193.59 KB

Yep. RTBC ++

That feels like a UI improvement to me.

Dialog is cleaner.

Still able to place an image, add a caption, align, etc. And resizing the image through the UI adds height and width in correct ratios.

DuaelFr’s picture

Do we still want to allow in-place resizing using the UI? I'm not sure.
That leads to the same problem where users doesn't understand that their huge picture is still huge after being resized there.
I think we should totally disable that functionnality and let contrib reintroduce it if needed. In the _near_ future, we'll be able to select an image style right from this Dialog so it should not be necessary anymore to have the ability to resize the image again.

What do you think?

Wim Leers’s picture

#13: IMO: one step at a time. This is the actual problem raised in usability tests. Let's fix this first.

DuaelFr’s picture

@Wim Leers : agreed!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

We were obviously missing test coverage of this feature too :)

Committed 9e2450b and pushed to 8.0.x. Thanks!

  • alexpott committed 9e2450b on 8.0.x
    Issue #2519862 by mErilainen, kattekrab, LewisNyman, Wim Leers, DuaelFr...
Wim Leers’s picture

Indeed :(

Wim--

See #2395377: Write integration test for EditorImageDialog for adding such test coverage.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.