TinyMCE prevent image resizing

Viewed 8539

I am adding an image to a TinyMCE editor using:

var params = {
             src: filename,
             title: "Attached image: " + filename,
             width: 500
             };

ed.execCommand("mceInsertContent", false, ed.dom.createHTML("img", params));

This insert the image correctly in the editor. However, when the user clicks on the image he has the ability of resizing it.

I would like to know if there is a way to:

  1. Prevent the user to resize only in one direction (i.e. how do I keep a fixed aspect ratio for the image)
  2. Completely prevent the user to resize the image
3 Answers
Related