U4-4729 - Make max dimensions of images in the RTE configurable

Created by Sebastiaan Janssen 21 Apr 2014, 10:45:43 Updated by Mads Krohn 11 Aug 2014, 12:23:37

Is duplicated by: U4-4967

Relates to: U4-4967

Relates to: U4-3933

We used to have this option in v6. Currently the width is hard coded within the umbraco.service.js.

1 Attachments


Robbie van den Hoven 22 Apr 2014, 14:36:47

The image gets scaled by the height of the RTE editor. So if you have an image that has a larger height than width (portrait). Than you can’t make it wider because the height of the image has its maximum set to the height of the RTE. RTE height set to: 500px and insert an image with site of 400x1000 will be scale to 200x500

umbraco: 7.1.1

Asbjørn Riis-Knudsen 26 Apr 2014, 20:49:14

It is completely crazy to have this enabled by default. It's fine as an ''option'', but definitely not as a hardcoded default. I do not want the RTE to arbritrarily resize my images to fit within a 500x500 px box!

Sebastiaan Janssen 28 Apr 2014, 09:14:32

@Asbjørn.Riis-Knudsen Okay, we get that it's a problem. Please relax.

Gavin Faux 26 Jun 2014, 10:45:49

Workaround were using in 7.1.3 to render image as uploaded/inserted is to modify dialogService.mediaPicker function in umbraco/js/umbraco.services.js

Line 5225: // editor.dom.setAttrib(imgElm, 'style', s); Line 5229: var src = img.url; // + "?width=" + newSize.width + "&height=" + newSize.height;

Asbjørn Riis-Knudsen 26 Jul 2014, 23:28:47

I have made a pull reqeust for this: https://github.com/umbraco/Umbraco-CMS/pull/433

Shannon Deminick 29 Jul 2014, 17:00:53

PR looks great, thanks a lot.

I wonder however, when we first install Umbraco, should we set the value to zero by default (no scaling) or leave it as is (500px) ?

Asbjørn Riis-Knudsen 29 Jul 2014, 18:02:04

I would vote for no scaling by default, but my PR kept the 500px for compatibility reasons.

Shannon Deminick 29 Jul 2014, 18:03:58

Yup saw that, happy to change it to not scale by default but would like some others' feedback just to make sure that's agreed with.

Anders Brohäll 29 Jul 2014, 18:39:40

No scaling per default! Never assume whats best for the user - the user is probably intelligent enough to decide the size of the images him/herself. Accessibility 1 on 1.

Brian Powell 29 Jul 2014, 23:09:01

I'd prefer scaling by default as long as I can easily undo it.

Daniel Hedenström 30 Jul 2014, 06:53:38

I would expect no scaling by default, since 500px is such an arbitrary number that probably fits very few designs perfectly and is problematic for any responsive site.

Claus Hingebjerg 30 Jul 2014, 07:29:34

500 was standard in v4-v6, but was easily changable. I would go for 500 as standard, and then make it easily editable like earlier versions. It wasn't broken then. No need to do it differently.

Sebastiaan Janssen 30 Jul 2014, 14:08:16

Note: we need to make these changes to the Grid datatype in 7.2.0 as well, this one has it's own RTE copy.

Shannon Deminick 01 Aug 2014, 00:45:45

@sebastiaan - Do you know if the grid data type has a fully configurable RTE like the normal RTE or ?

Currently it seems like a pretty even mixed opinion as to whether to ship with scaled or non-scaled images.

Sebastiaan Janssen 01 Aug 2014, 09:22:14

@Shandem Never mind, I just noticed it relies on the normal prevalue editor for the rte, yay!

Sebastiaan Janssen 01 Aug 2014, 09:27:45

With regards to scaling: It's always been a source of confusion. I'd rather answer "can I make this auto scale" a hundred times then "why the @#$% is it always 500px". So off by default, but that would probably mean a db migration needs to be written yes?

Sebastiaan Janssen 01 Aug 2014, 09:36:20

Changing my mind on this. It's a convenience for editors, who do not know or care about image sizes and will just upload any random 2000x1200 picture and then it's scary. Leave it at 500 default, it can always be changed to suit your site layout's needs.

Shannon Deminick 06 Aug 2014, 17:24:11

Ok, I'll close this issue then as there's no more required work, we'll leave the 500px in there as default since it's easy to change.

Claus Hingebjerg 07 Aug 2014, 06:25:49

Mads Krohn 08 Aug 2014, 21:58:11

I'm late to the party, sorry.

But wouldn't it be a lot more intuitive if images by default were the same width as the size of the editor ? At least, that's what I/my clients need for 90% of the time.

Also, have you considered not setting width and height attributes on the images? I've never really understood why that is needed. Perhaps there could be an option to disable size attributes so images could just be 100% width of the containing editor, which would make things easier, I think, on responsive designs.

Sebastiaan Janssen 11 Aug 2014, 12:15:25

No it would not, the size of the editor is not necessarily equal to the size of the block where the content is going to be presented.

As for your other question: that sound like a new feature request. I believe the problem at the moment is that we rely on the width and height in the RTE for resizing calculations.

Mads Krohn 11 Aug 2014, 12:23:37

Hah, good point :) And I believe you are correct, it will never be an optimal solution when the image size is calculated based on the size of the rte.

Priority: Major

Type: Feature (request)

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.1.1

Due in version: 7.1.5


Story Points: