RadBarCode GetImage throws GDI+ error on server

6 posts, 0 answers
  1. John
    John avatar
    16 posts
    Member since:
    Sep 2011

    Posted 13 Aug 2014 Link to this post

    When we use the RadBarcode.GetImage() running the asp.net 4.0 site inside the visual studio 2012 IDE all is well and we can save and display the png on our site.  When  running the site on the server we get the following error:

    A generic error occurred in GDI+.    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
       at System.Drawing.Image.Save(String filename, ImageFormat format)

    No other error information is provided.   Are there perhaps some other support assemblies needed that may be needed on the server?    This telerik upgrade is being tested on 2003 server, where all other telerik stuff works just fine for a number of sites.  Is it possible the older server just doesn't support some GDI+ functionality that you require, and our only option is to move to server 2008?

    We are in the process of switching our sites from rather ancient Windows Server 2003 to Windows Server 2008 so that's not a show-stopper.  We just weren't quite ready to deploy this testing site there.
  2. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 18 Aug 2014 Link to this post

    Hi John,

    I believe that the following forum thread could be helpful for you to resolve this generic ASP.NET error:

    http://stackoverflow.com/questions/1044085/a-generic-error-occurred-in-gdi.

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John
    John avatar
    16 posts
    Member since:
    Sep 2011

    Posted 19 Aug 2014 Link to this post

    I've read that document and don't believe it is related to the RadBarcode.GetImage problem (at least not in a way I can do anything about).  All the relevant activity takes place INSIDE the RadBarcode.GetImage() method, which is where the exception is thrown.  As far as I know, I have no way of affecting how RadBarcode decides to do its bitmap work and which graphics techniques it uses. All I can do is setup the barcode text/type properties and call GetImage().  As mentioned, I am guessing that the problem is related more to RadBarcode assuming some minimum amount of GDI+ support that is perhaps not present on our Windows 2003 webserver.  Can you verify this?
  5. John
    John avatar
    16 posts
    Member since:
    Sep 2011

    Posted 21 Aug 2014 Link to this post

    We get the same GDI+ error on windows server 2008 r2.  We running the site as .Net 4.0 and use the 4.0 versions of the telerik assemblies. This is becoming very serious for us. Can anyone provide any information on a solution?  Again, this is an error internal to the RadBarcode.GetImage() method.  It works fine on any of our development machines.  As mentioned before, the only information we get in the exception is the following, with no inner exception.  

    A generic error occurred in GDI+.    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)

  6. John
    John avatar
    16 posts
    Member since:
    Sep 2011

    Posted 21 Aug 2014 Link to this post

    Many reports on this GDI+ error (not just Telerik) stress a bad path.  Although we don't give any paths to the RadBarcode.GetImage(), perhaps it is internally assuming access to some undocumented path for temp working files?  If so, I can grant the proper access.  Just don't know what path it would be missing rights to.
  7. John
    John avatar
    16 posts
    Member since:
    Sep 2011

    Posted 21 Aug 2014 Link to this post

    (puts on hat of shame)
    Was not Teleriks problem.  I misinterpreted error and have resolved things with the usual privilege assignement related to GDI+ errors.  Apologies for the blame-telerik-first.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017