Opened 17 months ago

Closed 9 months ago

Last modified 36 hours 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:


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 (5)

comment:1 Changed 17 months ago by Reinmar

  • Status changed from new to confirmed

comment:2 Changed 17 months ago by t.jakut

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

comment:3 Changed 16 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 9 months ago by Tade0

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

comment:5 Changed 36 hours 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 36 hours ago by snobo (previous) (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy