ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.8k stars 2.48k forks source link

Image 2 Plugin: Aspect ratio locking didn't work when change image #1348

Closed ComvationAG closed 6 years ago

ComvationAG commented 6 years ago

Are you reporting a feature request or a bug?

type: Bug, plugin: image2

Provide detailed reproduction steps (if any)

  1. Open https://sdk.ckeditor.com/samples/captionedimage.html
  2. Doubleclick on image with rocket
  3. Change src to this image link: https://ckeditor.com/assets/images/og/ogimage-ck4.png
  4. Ensure that ratio is locked by lock symbol
  5. Change width to 300px
  6. Click now on "ok" to close image plugin dialog

Expected result

The new image should now updated with the prevented aspect ratio (widht: 300px, height: 157).

Actual result

The image is streateched, because the aspect ratio was not locked correctly. The problem is, that the plugin calculated behind the aspect ratio based on old image (instead of new image).

As workaround you must first save by clicking "ok" the changed image, and open then the image plugin dialog again. Then the size calculation with ratio locking works.

Other details

Thanks for investigate!

msamsel commented 6 years ago

From what I check problem is not a regression, the same behaviour was present in 4.7.3 and 4.6.2.