Broken proportions of the image #21

abdula opened this Issue Sep 28, 2012 · 4 comments


None yet
3 participants

abdula commented Sep 28, 2012

By increasing the picture when one side of the picture reaches the boundary of the editor, the second continues to increase, resulting in the broken proportion.


html5cat commented Sep 28, 2012

@abdula thanks for your feedback! This is not the official redactor-js website, however the issues here get read by the development team. If you have a support request feel free to forward it here

opes commented Oct 4, 2012

@abdula I fixed this problem by adding a second condition to the following line and adding an additional variable:

In the resizeImage method, add the following variable right at the beginning of the method:

var $el = this.$el;

Then in that same method, just down below, add a width testing condition to the following line:

if (new_h > min_h)

Change to:

if (new_h > min_h && new_w < $el.width())

Note that if you have a specified height on the redactor editor element, the image will be resizable beyond the boundaries of the height of the editor and this fix may not work. I'll see if I can tweak it a bit more and fix it.

abdula commented Oct 4, 2012

Thanks for help, but seems resizing images still not work correct. In
options of redactor i set autoresize:true; - base image - apply resize - apply resize

2012/10/4 opes

@abdula I fixed this problem by adding a
second condition to the following lines:

For the width:

if (new_w > min_w)

Change to:

if (new_w > min_w && new_h < this.$el.height())

And for the height:

if (new_h > min_h)

Change to:

if (new_h > min_h && new_w < this.$el.width())

This code isn't thoroughly tested, so I'm not sure if it breaks anything
else. Let me get back to you once I more thoroughly test it to verify.

Reply to this email directly or view it on GitHub

opes commented Oct 4, 2012

@abdula I updated my comment. Undo the height portion and try the above. I can't get it to work if the editable content has a specified height on it, but it works if you have just the width specified.

html5cat closed this Jun 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment