Opened 23 months ago

Closed 15 months ago

Last modified 4 months 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 23 months ago by Piotrek Koszuliński

Status: newconfirmed

comment:2 Changed 23 months ago by Tomasz Jakut

Owner: set to Tomasz Jakut
Status: confirmedassigned

comment:3 Changed 22 months ago by Tomasz Jakut

Status: assignedreview

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

comment:4 Changed 15 months ago by Tade0

Resolution: fixed
Status: reviewclosed

comment:5 Changed 6 months 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 onUploaded should obey the same setting, or we need a new one (though I think it would be more confusing).

Last edited 6 months ago by Gosh Snobo (previous) (diff)

comment:6 Changed 4 months 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 4 months ago by porjo

Cc: porjo added
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy