ck editor config image images

deactivate automatic set of image sizes in ckeditor4

Question

When you upload a picture with the default "image" plugin, it automatically inserts the width and height of that image. It saves it as a style attribute like style="width:1200px, height:300px" in the image tag.

In some cases, that could cause problem of rendering (image aspect ratio) with custom css.

Is there any way to fix that issue ?

Answer

The solution would be to deactivate the automatic insert of these styles:  https://github.com/ckeditor/ckeditor4/blob/master/plugins/image/plugin.js#L160

 

So what you have to do is to define a custom ckeditor config. It can be done in template set and add the property 

config.image_prefillDimensions = false;