Cannot getting editable image height & width in onclinetload

2 posts, 0 answers
  1. Chintha
    Chintha avatar
    11 posts
    Member since:
    May 2012

    Posted 24 Nov 2012 Link to this post

    The editable image height and width are getting '0' in firefox and other browsers.

    var imgWidth = editor.getEditableImage().get_width();
     var imgHeight = editor.getEditableImage().get_height();     

    image original height and width are getting only in internet can i get original width and height using all browsers.


     <telerik:RadImageEditor ID="rieControl" runat="server" OnImageLoading="rieControl_ImageLoading"
                            OnClientLoad="OnClientLoad" OnClientToolsDialogClosed="dialogclose" ExternalDialogsPath="ImageEditorDialogs"
                            ImageUrl="" OnClientCommandExecuted="OnClientCommandExecuted" ImageManager-EnableContentProvider="true"
                            Width="1030px" Height="700px" ToolsFile="~/XmlFiles/PbUserContentImageEditor_ToolBasic.xml">
                        </telerik:RadImageEditor> var editor = $find("<%= rieControl.ClientID %>");
     function OnClientLoad(sender, args) {
                if (sender._imageKey != undefined) {
      var imgWidth = editor.getEditableImage().get_width();
                    var imgHeight = editor.getEditableImage().get_height();                       
                    if (!isNaN(Number(imgWidth)) && Number(imgWidth) != 0 && !isNaN(Number(imgHeight)) && Number(imgHeight) != 0) {
                        if (imgWidth > 1000 || imgHeight  > 700) {
                            var widthPercentage = (1000 * 100) / Number(imgWidth);
                            var heightPercentage = (700 * 100) / Number(imgHeight);
                            widthPercentage = Math.floor(widthPercentage);
                            heightPercentage = Math.floor(heightPercentage);
                            if (heightPercentage > widthPercentage) {
                                objhdnReset.value = widthPercentage;
                            else {
  2. Vessy
    Vessy avatar
    1357 posts

    Posted 26 Nov 2012 Link to this post

    Hi Chintha,

    This is a known issue in RadImageEditor  which has already been logged into our PIT system. You could track its progress here:

    For the time being, you could workaround the problem by setting the ImageEditor's CanvasMode property to "No":
    <telerik:RadImageEditor ID="RadImageEditor1" runat="server" ImageUrl="~/Images/flowers.jpg" CanvasMode="No">

    Please, excuse us for the temporary inconveniences.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Telerik UI for ASP.NET Core is out
Back to Top