Parameter is NOT valid. Check image is good before displaying

4 posts, 0 answers
  1. Sameers
    Sameers avatar
    63 posts
    Member since:
    Oct 2004

    Posted 04 Feb 2011 Link to this post

    Hi,
        Recently, I found an issue that when an image is corrupted, and we try to assign it to RadBinaryImage, we get error "Parameter is not valid". Thats OutOfMemory exception, seems .NET can't load image properly then. However, this cause ASP.NET application to throw an "unhandled" exception.

       I wonder, if it was possible for telerik component to validate the image as it was assigned to it (like DataValue property) and throw an exception to indicate that assigned value is NOT a valid image. Currently, I have to load image, and if loads successfully, then I use my routine to convert the image to bytes and assign to DataValue property. 

       Though I see many threads on this topic "Parameter is not valid", as per I know, its "mysterious" ASP.net message and most of the time, caused by OutOfMemory exception. I wonder if this "check of validity of image" should be implemented in other controls of telerik, like reporting etc.

       Thanks,
       Sameers
  2. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 09 Feb 2011 Link to this post

    Hello Sameers,

    Please examine the Validate image from file in C# forum thread to see how to check whether a stream is a valid image file.

    I hope this helps.

    Greetings,
    Mira
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sameers
    Sameers avatar
    63 posts
    Member since:
    Oct 2004

    Posted 09 Feb 2011 Link to this post

    I already knew the issue and that how to solve it. the purpose of the post was to give a "suggestion" for telerik products to "validate" image and if found invalid, either continue or throw a proper message (or display default image)!

    thanks,
    Sameers
  5. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 11 Feb 2011 Link to this post

    Hello Sameers,

    Thank you for your feature request.

    I will forward it to our developers team and they will consider implementing it in future versions of RadControls for ASP.NET AJAX.

    Regards,
    Mira
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top