ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Inserting images should default to 50% of the editable

Open Witoso opened this issue 2 years ago • 5 comments

We had a discussion around the experience of inserting images. Currently, the images can be very large in resolution, and will most likely cover 100% of the editor. It's not the best UX. The content may jump a lot, will be lost etc.

https://github.com/ckeditor/ckeditor5/assets/9881379/471f0564-a848-463f-8361-b9f62c065f30

Scope

  • When inserting an image into the editor, and there's the ImageResize plugin, resize the image to 50%.
  • Add a config option to ImageResize, which could configure this (resizeOnInsert?): false, or any other value.

Questions

  • What if the image resize is in px?
  • how will the user know it's resized? Should they know? They see the size, and can compare it to the content's width.
  • Is 50% ok to be a default?

Witoso avatar Oct 06 '23 14:10 Witoso

@dagdzi, @Reinmar curious about your thoughts.

Witoso avatar Oct 06 '23 14:10 Witoso

Thoughts after the refinement, users may be confused what happened to the image, did it shrink in size, etc.?

Maybe a better option is to have it as an opt-in?

Witoso avatar Oct 09 '23 09:10 Witoso

Maybe a better option is to have it as an opt-in?

This is a base UX-related option and having it as opt-in will mean that:

  • we'll have to set it everywhere in our docs/demos configs,
  • >99% of integrators won't learn about it.

If we think that the 100%-wide images are a problem, this should be configurable, but enabled by default.

  • how will the user know it's resized? Should they know, they see the size, and can compare it to the content's width.

This is a very good question... It may be slightly confusing. I don't know any other app that scales them down.

  • What if the image resize is in px?

Good question again. And I think we could just calculate 50% of the editor's area width.

I'd add one more thing: Should vertical and horizontal images be treated similarly? A vertical image scaled to 50% looks, to me, relatively well. But a horizontal one looks odd – 75% would make more sense. And sometimes perhaps even 100% would be preferable. But if we make it too dynamic it may become too unpredictable and confusing.

So, I really miss seeing how users react to this in real life :( Which might not be easy to get.

Reinmar avatar Oct 10 '23 08:10 Reinmar

On our design guild meeting, we could give an obvious declaration that 50% (or any other value) is the sanest default. This comes together with a tricky technical implementation.

But we agree that certain pages/apps might have such need. Like us in the docs with high-resolution images.

The idea would be to give this possibility as an opt-in. Integrators who know best their apps, can define the default size, e.g.

resizeOptions: [
            {
                name: 'resizeImage:original',
                value: null,
                icon: 'original'
            },
            {
                name: 'resizeImage:50',
                value: '50',
                icon: 'medium',
                default: true // <- makes the inserted images 50% by default.
            },
            {
                name: 'resizeImage:75',
                value: '75',
                icon: 'large'
            }
        ],

This could be later (at the same time) implemented for image styling. To define a default style (class) of an image.

Witoso avatar Oct 11 '23 13:10 Witoso

I have the same problems,we are using the classic framework which didn't support resizeImage buttons.the uploader pics from users always too large.here are my two ways.

1.to set pics' width 50% in image.css file. the questions is the blue lines behind pics cannot escape at first time,now. 企业微信截图_c510dd27-5f85-4063-9882-a4a4fd910f45 2. I am still thinking how to set center as default,not full. 企业微信截图_38c09b87-7c97-4b08-ad04-3c2445733529

if it has any better solves ... ?

Sebastianyang666 avatar Jun 26 '24 04:06 Sebastianyang666

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Jun 26 '25 23:06 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Jul 27 '25 23:07 CKEditorBot