Forum Xamarin.iOS

NullReference exception when trying to get CGImageSource properties for a .eps file

danipendanipen USMember ✭✭
edited November 2018 in Xamarin.iOS

Hi, I'm trying to get the image properties for a .eps file, and I'm getting the following NullReferenceException:

Value cannot be null. 
Parameter name: dictionary

        at Foundation.DictionaryContainer..ctor (Foundation.NSDictionary dictionary) [0x00010] in /Library/Frameworks/Xamarin.Mac.framework/Versions/
        at CoreGraphics.CGImageProperties..ctor (Foundation.NSDictionary dictionary) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/
        at ImageIO.CGImageSource.GetProperties (ImageIO.CGImageOptions options) [0x00001] in /Library/Frameworks/Xamarin.Mac.framework/Versions/

Attached there is a .eps file that reproduces the issue.

Any help would be appreciated.


  • ColeXColeX Member, Xamarin Team Xamurai

    Can you post your code?

  • danipendanipen USMember ✭✭
    edited November 2018


                internal static string GetProperties(NSUrl url)
                    using (CGImageSource imageSource = CGImageSource.FromUrl(url))
                        if (imageSource == null)
                            return string.Empty;
                        CoreGraphics.CGImageProperties properties =
                         return ConverToString(properties);
Sign In or Register to comment.