Class that contains information about an image format.
Example #1
0
 private void SetFormat(ImageFormat format)
 {
     SetFormat(MagickFormatInfo.GetFormat(format));
 }
Example #2
0
    /// <summary>
    /// Returns true when the supplied formation information is supported.
    /// </summary>
    /// <param name="formatInfo">The format information to check.</param>
    /// <returns>True when the supplied formation information is supported.</returns>
    public bool IsSupported(MagickFormatInfo formatInfo)
    {
      if (formatInfo == null)
        return false;

      foreach (IImageOptimizer optimizer in _Optimizers)
      {
        if (optimizer.Format.Format == formatInfo.Module)
          return true;
      }

      return false;
    }
Example #3
0
 /// <summary>
 /// Returns true if the supplied file name is supported based on the extension of the file.
 /// </summary>
 /// <param name="fileName">The name of the file to check.</param>
 /// <returns></returns>
 public bool IsSupported(string fileName)
 {
     return(IsSupported(MagickFormatInfo.Create(fileName)));
 }
Example #4
0
 /// <summary>
 /// Returns true if the supplied file name is supported based on the extension of the file.
 /// </summary>
 /// <param name="file">The file to check.</param>
 /// <returns></returns>
 public bool IsSupported(FileInfo file)
 {
     return(IsSupported(MagickFormatInfo.Create(file)));
 }
Example #5
0
 /// <summary>
 /// Returns the format information of the specified format.
 /// </summary>
 /// <param name="format">The image format.</param>
 /// <returns>The format information.</returns>
 public static MagickFormatInfo GetFormatInformation(MagickFormat format) => MagickFormatInfo.Create(format);
Example #6
0
 /// <summary>
 /// Returns the format information of the specified format based on the extension of the
 /// file. If that fails the format will be determined by 'pinging' the file.
 /// </summary>
 /// <param name="fileName">The name of the file to get the format for.</param>
 /// <returns>The format information.</returns>
 public static MagickFormatInfo GetFormatInformation(string fileName) => MagickFormatInfo.Create(fileName);
Example #7
0
 /// <summary>
 /// Returns the format information of the specified format based on the extension of the file.
 /// </summary>
 /// <param name="file">The file to get the format for.</param>
 /// <returns>The format information.</returns>
 public static MagickFormatInfo GetFormatInformation(FileInfo file) => MagickFormatInfo.Create(file);
Example #8
0
 /// <summary>
 /// Returns the format information of the specified format based on the extension of the
 /// file. If that fails the format will be determined by 'pinging' the file.
 /// </summary>
 /// <param name="fileName">The name of the file to get the format for.</param>
 /// <returns>The format information.</returns>
 public static MagickFormatInfo GetFormatInformation(string fileName)
 {
     return(MagickFormatInfo.Create(fileName));
 }
Example #9
0
 /// <summary>
 /// Returns the format information of the specified format.
 /// </summary>
 /// <param name="format">The image format.</param>
 /// <returns>The format information.</returns>
 public static MagickFormatInfo GetFormatInformation(MagickFormat format)
 {
     return(MagickFormatInfo.Create(format));
 }
Example #10
0
 /// <summary>
 /// Returns the format information of the specified format based on the extension of the file.
 /// </summary>
 /// <param name="file">The file to get the format for.</param>
 /// <returns>The format information.</returns>
 public static MagickFormatInfo GetFormatInformation(FileInfo file)
 {
     return(MagickFormatInfo.Create(file));
 }
Example #11
0
        private static MagickFormat GetModule(MagickFormat format)
        {
            MagickFormatInfo formatInfo = MagickNET.GetFormatInformation(format);

            return(formatInfo.Module);
        }