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

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

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

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

            return(FileFormat.FromFileExtension(ext));
        }
Esempio n. 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));
        }