Search code examples
imagetinymcesize

How to stop TinyMCE to change the image size after editing its name?


I control the size of my image in a page by CSS imgType.

 <img class="imgType" style="..." src="/image1.jpg" alt="..." />

If I edit the image to change its name only (the fields width & height stay empty and save the content of the editor, tiny writes a value for both the width and height.

 <img class="imgType" style="..." src="/image2.jpg" alt="..." width="249" height="145" />

I tried to use object_resizing : false, but it does not do anything.

How can I stop tiny to write these values?


Solution

  • You can remove the image dimensions from the Insert/Edit Image dialog with:

    image_dimensions: false
    

    Docs: https://www.tiny.cloud/docs/tinymce/6/image/#image_dimensions