Example #1
0
        private static MagickFormat GetMagickFormatForFileExtension(string fileExtension)
        {
            MagickFormat?key = ImageMagickUtilities.GetMagickFormatFromFileExtension(fileExtension.ToLowerInvariant());

            if (!key.HasValue)
            {
                throw new UnsupportedFileFormatException();
            }

            return(key.Value);
        }
Example #2
0
        private static IFileFormat GetImageFormatFromMagickFormat(MagickFormat magickFormat)
        {
            string ext = ImageMagickUtilities.GetFileExtensionFromMagickFormat(magickFormat);

            if (string.IsNullOrEmpty(ext))
            {
                throw new UnsupportedFileFormatException();
            }

            return(FileFormat.FromFileExtension(ext));
        }
Example #3
0
        private static IFileFormat GetImageFormatFromMagickFormat(MagickFormat magickFormat)
        {
            string ext = ImageMagickUtilities.GetFileExtensionFromMagickFormat(magickFormat);

            if (string.IsNullOrEmpty(ext))
            {
                throw new FileFormatException(IO.Properties.ExceptionMessages.UnsupportedFileFormat);
            }

            return(FileFormatFactory.Default.FromFileExtension(ext));
        }