A generic error occurred in GDI+


#1

When attempting to select an image file for upload I see

Error: A generic error occurred in GDI+.

I am using Version 3.1.0

—here’s-a-big-snip-from-log-file—
2018-05-07 07:38:11.3266|ERROR|SRP.Global|Application error: Exception of type ‘System.Web.HttpUnhandledException’ was thrown. - at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2018-05-07 10:41:00.5315|ERROR|GRA.SRP.ControlRoom.Control|Error checking permissions: Object reference not set to an instance of an object.
2018-05-07 10:41:46.4441|ERROR|GRA.SRP.ControlRoom.Modules.Setup.BadgeAddEdit|Couldn’t copy no_badge images into new badge: Could not find a part of the path ‘C:\inetpub\wwwroot\images\Badges\no_badge.png’.
2018-05-07 10:48:08.5843|ERROR|GRA.SRP.ControlRoom.Controls.OpenBadgesBadgeMaker|Error in image returned from badge maker: A generic error occurred in GDI+. - at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at GRA.SRP.ControlRoom.Controls.OpenBadgesBadgeMaker.Page_Load(Object sender, EventArgs e)
2018-05-07 11:15:23.9626|ERROR|GRA.SRP.ControlRoom.AJAX|Error checking permissions: Object reference not set to an instance of an object.
2018-05-07 11:31:13.1377|ERROR|GRA.SRP.ControlRoom.AJAX|Error checking permissions: Object reference not set to an instance of an object.
2018-05-07 17:30:33.8464|ERROR|SRP.Global|Application error: Exception of type ‘System.Web.HttpUnhandledException’ was thrown. - at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


#2

My thoughts on this:

  1. Make sure the no_badge.png file is in C:\inetpub\wwwroot\images\Badges\no_badge.png
  2. Ensure that the Web server user can write to the badge directory. I suspect this is permissions-related.

#3

Thanks… I think my web server user is weird? not sure. I saw IUSR and another domain user (which I will have to look at - at work tomorrow - something with the IIS_Thingy …)

(where is the image directory configured? I had to create one … and now I think it used to be on another box, maybe due to space limitation … I’d like to check that.)

(I have used this for years… but I broke it when I reverted to v.3… my 2008 server can’t do v.4, and I will try to do v.4 in the cloud … asap.)

tb


#4

It depends on the version of your server, things changed a bit with IIS 7 which is the version that I think comes with Windows Server 2008. I think you can just use the IIS_IUSRS group and that will handle it.

I think it’s the images folder in wwwroot that needs to have read, write, and modify permissions on it. What I wrote in the manual for 3 was to just give the IIS_IUSRS group Full control to the wwwroot folder which is being generous with permissions but ensures that there are no permissions limitations.

The good news about v.4 is that it will run in Windows or Linux and it should be able to run with MySQL (I have not added that code yet but soon, hopefully). We’re running it in Docker here which keeps the environment completely isolated and makes these server incompatibilities and worrying about permissions a thing of the past.


#5

Somewhere I hosed a permission setting. Here is where I fixed my issue.

  1. Internet Information Services (IIS) Manager (my SRC is the DEFAULT) select Authentication
  2. Advanced Settings …
  3. Under the General settings select -> Physical Path Credentials
  4. Click the ellipsis dots “…” on right to use Specific User: instead of Application user (pass-through authentication)
    I used my login which I know has access to the wwwroot directories…

#6

I’m wrong. I have not fixed the GDI+ error. As soon as I select a graphic to upload, I still see the error.


#7

Using the " Make sure the no_badge.png file is in C:\inetpub\wwwroot\images\Badges\no_badge.png" hint… it seems like there need to be placeholders for images, banners, badges, …

I found a slew of graphics in a “shared” folder, and moved them into the C:\inetpub\wwwroot\images corresponding locations…

Now I can modify graphics that presented the GDI+ error…