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);
}
}
}
}
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);
}
}
}
}