Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There when in editor I add image and change only width but leave height empty there not put value for me with calculation. It support to be.
For example my image size is 1000x500. So I put in image width 200 and leave height empty and when click save button there mast be made calculation for height and save that value except situations when user pet height value by hand. The same for width if only value in height input.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2014-03-24_1146.png | 174.06 KB | Codenator |
#2 | 2014-03-24_1146_001.png | 31.67 KB | Codenator |
Comments
Comment #1
Codenator CreditAttribution: Codenator commentedhttp://youtu.be/uoeWG5wGL58
Comment #2
Codenator CreditAttribution: Codenator commentedComment #3
Codenator CreditAttribution: Codenator commentedComment #4
tim.plunkettI think this is just a bug. Nice find!
Comment #5
Wim LeersThanks for filing this issue and taking the time to record a screencast!
Before I work on this though, #2039163: Update CKEditor library to 4.4 must be committed, because that might affect the solution, since it comes with a big improvement in the code handling images inside CKEditor. Once that lands, I will look into this again :)
Comment #6
MarkusDBX CreditAttribution: MarkusDBX commentedI investigated this bug today. After the update to CKEditor 4.4 was fixed.
There is still no automatic height calculation being done, it's just an empty value.
So when using only width to scale images, only the width-attribute is forwarded to source. This fixes the issue with the too heigh images.
However... when using only height, and not width to scale the images. Resulting in images getting only the height attribute in source. Nothing happens in the frontend theme, but it's correctly scaled in ckeditor. This might confuse users.
The reason to this is many themes just overrides the image height with css, like this:
img{height: auto;}
So I guess the height/width auto calculation is still needed, because otherwise scaling by height will not work, since it's seem to be depending on the width attribute.
Question: Is the user supposed to be able to only enter the height attribute on images? (Since it will not work today with most themes by default, nothing will happen).
Comment #7
Wim LeersComment #8
MarkusDBX CreditAttribution: MarkusDBX commentedComment #9
Wim LeersWe removed the width/height settings in the image dialog. Hence we indirectly solved this issue.
There still is the image resizing drag handle, which does work correctly. In 8.1 we should have #2061377: [drupalImage] Optionally apply image style to images uploaded in CKEditor 5, which will make all of these problems definitely a thing of the past.