This was our first go at images in the new editor - we want to simplify handling of images for the editor so images look nice regardsless of where they are placed - but I guess this solution is waaay to crude - we should probably add some classes instead.
Any special requirements you would like to see solved?
There should be options for whether we want to scale the image or not (?size=640&scaleWidth=true), and also the possibility to define different scaling widths/heights (ie. small, medium, large). Right now we can’t find a way to insert the original image in scale 1:1.
As for presentation, I think classes is the way to go.
Hmm… First of all you should not worry about the src field when using the editor, but rather focus on what is actually stored. You will see we are not preserving any 640 stuff when saving - this is just inner magic to optimize admin UI.
I guess we might be missing some relevant documentation on how this is actually handled - and some more features like you request would naturally be useful.
User inserts image in WYSIWYG-editor. - Save Draft & Publish
If we switch to code view in editor, we can see that ?size=640&[…] is inserted.
In template: <div data-th-utext="${portal.processHtml({'_value=' + article.data.body})}">. Actual HTML being inserted is this <img style="width: 100%;" src="/admin/portal/preview/draft/unox/privat/smreolje/_/image/633a743a-9c5a-4ec7-8844-27208118a34a/width-768/sykkelglede_2000x1333.jpg.jpeg" alt="sykkelglede_2000x1333.jpg" /> even though the image is way smaller than this. If the user wants to insert an icon that is 20 x 30px, the image is being scaled to 768. Inline style width: 100% is also being inserted, so we have to use an !important rule in our CSS to make sure that the image never scales more than 100% of its width.
We’re creating inline styles for the editor in our next release (6.3), it will make inline image handling super-simple, including effects, use of original or optimized images etc…