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

ImageGallery to ImageEditor

1 Answer 32 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 14 Sep 2015, 09:04 PM

Hello,

I am attempting to load an image in an ImageGallery to an ImageEditor. What I am doing to get the path of the image from the gallery to the editor is -

$(function () {
  $('#imageEditor').addClass('hideDisplay').hide();
  $('#ctl00_cphPopupContent_RadImageGallery1_ImageArea').click(function () {
        if ($('#imageEditor').hasClass('hideDisplay')) {
            imageToEdit = $('img').attr('src');
            getAjaxManager().ajaxRequest(imageToEdit);
            $('#imageEditor').fadeIn(1000).removeClass('hideDisplay').show();
            $('#imageGallery').fadeOut(1000).addClass('hideDisplay').hide();
      }
      else {
            $('#imageEditor').addClass('hideDisplay').hide();
            $('#imageGallery').removeClass('hideDisplay').fadeIn(1000).show();
       }
    });
});

As you can see I am loading it into the editor through an ajax request - 

protected void RadAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    RadImageEditor1.ResetChanges();
    RadImageEditor1.ImageUrl = e.Argument;
}

It works fine. I can make edits to the image but when it comes time to save it on the server I get this client side error - 

Unhandled exception at line 6, column 50445 in 
http://localhost:12234/V5/r1/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35:
en-US:47de63c8-89d4-489c-bfde-4185a11627a3:ea597d4b:b25378d2;
Telerik.Web.UI:
en-US:4f93cdea-660e-49e9-b57d-168c603f1b46:16e4e7cd:f7645509:ed16cbdc:24ee1bba:52af31a4:5fa37e7e:68f76a79:874f8ea2:2a2fc429:
c1602281:56e9f55f:c128760b:a47717cc:567f529f:ddbfcb67:4877f69a:c2527c5e:92fe8ea0:389cfa1c:f46195d3:fa31b949:607498fe:9cdfc6e7:
86526ba7:88144a7a:1e771326:a7e79140:c172ae1e:e330518b:2003d0b8:c8618e41:e4f8f289:1a73651d:333f8d94

0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize empty string.

Parameter name: data

I do have the handlers in place in the Web.config file

And it never reaches the method below - 

protected void RadImageEditor1_ImageSaving(object sender, ImageEditorSavingEventArgs e)
{
    //Save the image to a custom location
    string fullPath = originalFileLocation + @"\" + JobNo;
             
    string fileName = e.FileName;
 
    fullPath = Path.Combine(fullPath, fileName);
 
    Telerik.Web.UI.ImageEditor.EditableImage img = e.Image;
 
    img.Image.Save(fullPath);
 
    e.Cancel = true;
}

Any help would be appreciated. 

Thank you

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 17 Sep 2015, 04:29 PM
Hi Dough,

The most probable reason for the experienced error is that a big image is edited (respectively saved) in RadImageEditor. This scenario and the way to work around it is explain in details in the following help article, so I would advice that you try the configurations given in it: Saving Large Images

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ImageEditor
Asked by
Doug
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or