Skip to content

JIT exception thrown when creating animated gif on iOS #762

Closed
@dmanning23

Description

@dmanning23

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

When creating animated gifs on iOS devices, a JIT exception is thrown by the quantizer and the operation fails:

Attempting to JIT compile method 'SixLabors.ImageSharp.Processing.Processors.Quantization.OctreeFrameQuantizer`1/Octree/OctreeNode<SixLabors.ImageSharp.PixelFormats.Rgba32>:ConstructPalette (SixLabors.ImageSharp.PixelFormats.Rgba32[],int&)' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.

The WuQuantizer throws a similar exception:

Attempting to JIT compile method 'SixLabors.ImageSharp.Processing.Processors.Quantization.WuFrameQuantizer`1<SixLabors.ImageSharp.PixelFormats.Rgba32>:GetPalette ()' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.

The Xamarin link in the exception message mentions decorating the method with the UnmanagedFunctionPointerAttribute to fix the problem.
https://docs.microsoft.com/en-us/xamarin/ios/internals/limitations#no-dynamic-code-generation

Steps to Reproduce

I see this error everytime I try to create an animated gif on iOS.
I have a sample project here that demonstrates the problem:
https://github.com/dmanning23/MonogameScreenToolsExample
https://github.com/dmanning23/MonogameScreenTools

System Configuration

I'm seeing this issue on an iPhone 5S running iOS 12.0.1

  • ImageSharp version: I am using the "dev" package from the ImageSharp nightly myget stream.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions