Opened 19 months ago

Closed 11 months ago

Last modified 12 days ago

#13794 closed New Feature (fixed)

[UploadImage] Use uploaded.width/height if set

Reported by: Reinmar Owned by: t.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 19 months ago by Reinmar

  • Status changed from new to confirmed

comment:2 Changed 19 months ago by t.jakut

  • Owner set to t.jakut
  • Status changed from confirmed to assigned

comment:3 Changed 19 months ago by t.jakut

  • Status changed from assigned to review

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

comment:4 Changed 11 months ago by Tade0

  • Resolution set to fixed
  • Status changed from review to closed

comment:5 Changed 2 months ago by 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 2 months ago by snobo (previous) (diff)

comment:6 Changed 12 days 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 12 days ago by porjo

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