This is a migrated thread and some comments may be shown as answers.

Cannot getting editable image height & width in onclinetload

1 Answer 56 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Chintha
Top achievements
Rank 1
Chintha asked on 24 Nov 2012, 07:11 AM
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 explorer.how can i get original width and height using all browsers.

aspx:

 <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 %>");
script:
 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) {
                            sender._zoomImage(widthPercentage);
                            objhdnReset.value = widthPercentage;
                        }
                        else {
                            sender._zoomImage(heightPercentage);
                       }
                    }
                }
            }

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 26 Nov 2012, 01:42 PM
Hi Chintha,

This is a known issue in RadImageEditor  which has already been logged into our PIT system. You could track its progress here: http://www.telerik.com/support/pits.aspx#/details/Issue=13356.

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">
</telerik:RadImageEditor>

Please, excuse us for the temporary inconveniences.

Regards,
Vesi
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.
Tags
ImageEditor
Asked by
Chintha
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or