Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#13794 closed New Feature (fixed)

[UploadImage] Use uploaded.width/height if set

Reported by: Piotrek Koszuliński Owned by: Tomasz Jakut
Priority: Normal Milestone: CKEditor 4.6.0
Component: General Version: 4.5.0
Keywords: Cc: porjo

Description

Split from #13520. Requires #13518.

The server should be able to return width and height of the image. #13518 will assure that these properties are propagated to the onUploaded callback. In this ticket we need to use these properties (if defined) to set width and height of the resulted image.

Change History (7)

comment:1 Changed 8 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:2 Changed 8 years ago by Tomasz Jakut

Owner: set to Tomasz Jakut
Status: confirmedassigned

comment:3 Changed 8 years ago by Tomasz Jakut

Status: assignedreview

Done, using loader.responseData property introduced by #13519. Pushed branch:t/13794.

comment:4 Changed 8 years ago by Tade0

Resolution: fixed
Status: reviewclosed

comment:5 Changed 7 years ago by Gosh Snobo

I would propose to reopen this ticket. Currently, onUploaded sets image width & height if non-empty values are returned from server, otherwise it sets $img.naturalWidth & $img.naturalHeight. But I think it should be a valid scenario to NOT set width/height, e.g. to allow for responsive images (those with max-width=100% in the CSS).

In case of traditionally uploaded image, config.image2_prefillDimensions setting serves exactly this purpose. In case of dropped upload, however, this setting has no effect. So imho either the same setting should be also obeyed by onUploaded, or we need a new setting (though I think it would be more confusing).

Version 2, edited 7 years ago by Gosh Snobo (previous) (next) (diff)

comment:6 Changed 7 years ago by porjo

Could someone please update the ImageUpload doco here http://docs.ckeditor.com/#!/guide/dev_file_upload to mention the ability to set 'width' and 'height' from the backend.

comment:7 Changed 7 years ago by porjo

Cc: porjo added
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy