Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Default motion detection example for v0.6 throws "Unhandled exception. System.TypeInitializationException: The type initializer for 'Gdip' threw an exception." #195

@IKoshelev

Description

@IKoshelev

I have a .NET 5 app, referencing MMALSharp v0.6, building and running on Pi 4 (2Gb) Raspbian Lite, copypasted default motion detection example verbatim from https://github.com/techyian/MMALSharp/wiki/Advanced-Examples/93b717ebbf4502f3a6c1ef99137a6b416dd0c3e6#FrameDiffDetection , getting an exception:

Unhandled exception. System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory
   at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at MMALSharp.Processors.Motion.FrameDiffAnalyser.LoadBitmap(MemoryStream stream)
   at MMALSharp.Processors.Motion.FrameDiffAnalyser.PrepareDifferenceImage(ImageContext context, Int32 threshold)
   at MMALSharp.Processors.Motion.FrameDiffAnalyser.CheckForChanges(Action onDetect)
   at MMALSharp.Processors.Motion.FrameDiffAnalyser.Apply(ImageContext context)
   at MMALSharp.Handlers.CircularBufferCaptureHandler.Process(ImageContext context)
   at MMALSharp.Callbacks.PortCallbackHandler`2.Callback(IBuffer buffer)
   at MMALSharp.Callbacks.VideoOutputCallbackHandler.Callback(IBuffer buffer)
   at MMALSharp.Ports.Outputs.VideoPort.NativeOutputPortCallback(MMAL_PORT_T* port, MMAL_BUFFER_HEADER_T* buffer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions