Bug 9580 - System.Drawing.GDIPlus file not found exception
Summary: System.Drawing.GDIPlus file not found exception
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Drawing ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-01-15 15:17 UTC by tadaP
Modified: 2013-01-16 01:58 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 9580 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description tadaP 2013-01-15 15:17:44 UTC
When I build the below piece of code

                MemoryStream imageStream = new MemoryStream(imageData);
       System.Drawing.Image screenImage = Bitmap.FromStream(imageStream, true, true);
       screenImage.Save(screenShotPath, ImageFormat.Jpeg);

in .Net on Windows and use mono to launch in MAC, I get the below error

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libgdiplus.dylib
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x000cc] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:127 
  --- End of inner exception stack trace ---
  at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00077] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:290 
  at System.Drawing.Image.LoadFromStream (System.IO.Stream stream, Boolean keepAlive) [0x00011] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:164 
  at System.Drawing.Image.FromStream (System.IO.Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:156 
  at VMImageDump.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libgdiplus.dylib
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x000cc] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:127 
  --- End of inner exception stack trace ---
  at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00077] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:290 
  at System.Drawing.Image.LoadFromStream (System.IO.Stream stream, Boolean keepAlive) [0x00011] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:164 
  at System.Drawing.Image.FromStream (System.IO.Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:156 
  at VMImageDump.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 


At the same time, when I build the code snippet in Mono on MAC, everything just works fine.