Hi.
Is there a way to handle image inline resizing? I just want to put some code there after image was resized.
Thanks in advance.
Is there a way to handle image inline resizing? I just want to put some code there after image was resized.
Thanks in advance.
Re: Inline Image Resize Handler
This would be incredibly useful. If we could get a callback on this event (or modification from the context menu as well) it would enable me to solve one of the most annoying user problems with the CKEditor.

This problem is that users always, without fail re-size the image in the editor expecting the actual file size to change. The only exceptions to this rule are technically-minded individuals with web experience, it is otherwise counter-intuitive to the average user who doesn't understand that they aren't working with a tool like Microsoft Word and that images are not a part of the document. It's a prevalent problem and one that deserves addressing. If we had some way to easily detect file changes via a JavaScript callback I could address the situation in the following manner:
Steps:
1) User re-sizes image.
2) My Custom Callback Triggered
3) Within Callback: Communicate with the server to make a copy of the re-sized image at the indicated size. The copy would use some kind of unique identifier and store the original path in the database to detect future changes to a copy so we can always go from the original instead of copying the copy.
4) Within Callback: Change the source of the re-sized image dynamically to reflect the new re-sized copy.
5) CKEditor resumes its regularly scheduled programming
In the future, if the server receives a request to re-size an image with a name matching a copy it will simply update that copy from the original file (if the original file is available, otherwise it could remove that copy instance from the database and treat it as an original file following step 3 and 4 normally).
Ideally we would have a way to indicate -which- image tag was re-sized so we knew where to replace the source in the case of more than one identical image being linked in the same editor window. This is just a corner case though, it's not so likely someone would have more than one image of the same source and then begin re-sizing them... But I -can- see it happening with default images etc, so it would be good to make this work.
The only other option I'm left with is to parse the HTML and pick out the uses of images and their respective sizes and perform this replacement and processing at submission time. This option is fine except that it requires some very specific parsing requirements.
Re: Inline Image Resize Handler
I cant find ANY documentation on what events are sent by browsers during or after object resizing (since resizing accomplished using execCommand enableObjectResizing). I found some mentions of "startResize" event, but never captured it even by creating easy sample.
Please, HELP somebody! I never stuck 'cuz i getting a lot of ideas on how to do that, but lately they are becoming insane!
Re: Inline Image Resize Handler
Re: Inline Image Resize Handler
Re: Inline Image Resize Handler
Thanks for the inputs, there's already a ticket on this which will be scheduled soon. It would be great if you could even come with a plugin for it.
Re: Inline Image Resize Handler
thanks! looking forward to it!
wow, its 2 years old
Re: Inline Image Resize Handler
Yeah, if someone familiar with the CKEditor code base were to create this event I would certainly make whatever developments I complete which act on that event public. I hope this ticket is addressed soon, thanks!
Re: Inline Image Resize Handler
Re: Inline Image Resize Handler
Re: Inline Image Resize Handler
I mean: when resizing an image in the editor the size of the image gets refreshed, so there must me an "onresize handler" already there, or?
Re: Inline Image Resize Handler
This would be very useful. I'm having a hard time creating a custom handler to maintain image aspect ratio after resizing. It seems I can't even access the inserted image object to attach an `onmouseup` event. A callback, documented in the API, would fix that.