-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the image resize balloon #16140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You can submit an invalid value. I think we need to validate these for empty values just like links or media
Screen.Recording.2024-04-09.at.14.50.02.mov
- When in px, there's a min value limit set to 50px. This is no good because we allow for resizing inline images too that are often used as emoji or just really small images (see the docs). They go way below 50px limit.
![image](https://private-user-images.githubusercontent.com/1099479/320852660-5d43e129-12df-42d7-85d7-27a934891600.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMjY1NTksIm5iZiI6MTcyMjIyNjI1OSwicGF0aCI6Ii8xMDk5NDc5LzMyMDg1MjY2MC01ZDQzZTEyOS0xMmRmLTQyZDctODVkNy0yN2E5MzQ4OTE2MDAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMDQxMDU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjFmZWRkYWM5M2FmOGJjNTllMWVlMzE5NTViZTIzMmZmNzM1OTFhYjA5OWJhNjkyNzhlNjE0MDE5ODMyMzIyNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.JtQQwtTdR-TR7SGrmn0FVXGlKd_cJaBdr5LICjv-HJA)
![image](https://private-user-images.githubusercontent.com/1099479/320852927-55f848f5-b94b-4bef-9ec5-621d114a9371.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMjY1NTksIm5iZiI6MTcyMjIyNjI1OSwicGF0aCI6Ii8xMDk5NDc5LzMyMDg1MjkyNy01NWY4NDhmNS1iOTRiLTRiZWYtOWVjNS02MjFkMTE0YTkzNzEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMDQxMDU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzBmZmFmZjg1ZTYwNjFkOTE3NjZjZWYwOGIyYzgyNTQ1ZWM0YTI1M2NiOWUyMDQzMTBkYTdkNjJlMmJjZjI4NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.G3g7uirJSSCM2FtkvE6ve-zicEzxWcfyAs9q4CgK-ZA)
- When in px, the upper limit of 2400 is also problematic. You can easily use a wider hero image in HiDPI than 2400 (or especially for print, export to PDF).
![image](https://private-user-images.githubusercontent.com/1099479/320854552-53c805c1-c148-4eff-9c87-a4d1064d4ac0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMjY1NTksIm5iZiI6MTcyMjIyNjI1OSwicGF0aCI6Ii8xMDk5NDc5LzMyMDg1NDU1Mi01M2M4MDVjMS1jMTQ4LTRlZmYtOWM4Ny1hNGQxMDY0ZDRhYzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMDQxMDU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2I5NzIzNjkxMWMxMjU0MTE5MGY3NDU4M2JmZDNiYjMyNjAxMDhjMzU4MTgwYzUwYjA0Y2FkNTgzMjhkMDU5OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.3YBqcPm7BlgfuCntsqqldaFrjieooJsWEaD93AtBFzA)
- There's something odd going on with units and I spotted it in the picture manual test. The input label is in % but the value is clearly in px (put 100 there and it will commit as 100%, though)
![image](https://private-user-images.githubusercontent.com/1099479/320855247-50240b34-10da-4001-b84c-a5882ea5087f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMjY1NTksIm5iZiI6MTcyMjIyNjI1OSwicGF0aCI6Ii8xMDk5NDc5LzMyMDg1NTI0Ny01MDI0MGIzNC0xMGRhLTQwMDEtYjg0Yy1hNTg4MmVhNTA4N2YucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMDQxMDU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzU4NGVhYTQ4ZDY0YTcwYzI4MWI4ZTQzMjIwYjBmMTczYWE2ODQ2ZmE2OTBiYzI4MDViNDdkZmU3M2Y5NzlmYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.INyozWrZNhpkg5LDYJgDBmSif_9MZAb-euD5tCx8ybA)
@oleq Good catch, will be fixed. I'll change a bit min / max values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oleq All reported CR remarks fixed. |
Two more problems that I noticed:
Screen.Recording.2024-04-11.at.14.34.35.mov |
@oleq Fixed |
@oleq I fixed all CR remarks. |
Inconsistencies when it comes to the minimal value that can be insertedSteps
ResultsThe minimal value that can be inserted is 0,2 - both for inline and block images: resize-minimal.mp4However, an inline image can be made smaller using the resize handler: And at the same time, a block image can't be made that small and incorrect values are shown from a certain point: image-block.mp4 |
Resize balloon shows a wrong maximum image size in pixelsSteps
ResultResize balloon allows for setting the size to 1600 px, while the image has only 1548 px at its maximum size and this is what's shown after resize handler is used: max-size.mp4 |
@charlttsie Please pull, some modifications regarding image resize range have been pushed. |
@Mati365 percent.mp4So, I'm not sure if that's within the scope 🤔 |
@charlttsie It's out of scope, this is not related to this particular implementation (as it just works identically as "draggable" one). Anyway - thanks for report. |
Regarding #16140 (comment), when I take the same image from http://localhost:8125/ckeditor5-image/tests/manual/imageresizepx.html and resize it using resize handler, the size shown is 1548 px and it also shows inside the resize balloon field. However, when I want to submit it, it won't get accepted: max-size.mp4 |
#16140 (comment) looks good 👍 |
FYI: I reported the issue with the incorrect size when shrinking a block image here: #16208 |
We've finished testing with @kubaklatt and @mabryl and besides the already reported and fixed issues, the PR looks good. Thank you @Mati365 for the quick fixes 🎉 |
@oleq UI update test added. |
Suggested merge commit message (convention)
Feature (image): Add custom image width input option in the image editing toolbar, as an alternative to drag-and-drop resizing
Additional information
Related to https://github.com/cksource/ckeditor5-commercial/issues/6023
![obraz](https://private-user-images.githubusercontent.com/3949262/319153691-bc11c088-bc3b-4167-9668-7e908ea3cb0d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMjY1NTgsIm5iZiI6MTcyMjIyNjI1OCwicGF0aCI6Ii8zOTQ5MjYyLzMxOTE1MzY5MS1iYzExYzA4OC1iYzNiLTQxNjctOTY2OC03ZTkwOGVhM2NiMGQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMDQxMDU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGE3MzFiYTBjNmMzZDRiNDViODQ4NmRmYTBkNTE5NTVhNWU4MzkxMTRkYzdmZGU4ZTEzODgyNjE5NmRiMmIzZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.JYoqwqZRmQERFZMF0lNSzWoqAstg9j49czz9i3hc3to)
![obraz](https://private-user-images.githubusercontent.com/3949262/319153805-ac71f356-51b8-457f-ae68-7d714cbfea93.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3Lmdpd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