Ejemplo n.º 1
0
 public void GetNegativeQuality()
 {
     var expected = new GifFormat();
     var i = new Imaging();
     foreach (var extension in expected.FileExtensions)
     {
         var format = i.Get(extension, -45);
         Assert.AreEqual(Imaging.DefaultImageQuality, format.Quality);
     }
 }
Ejemplo n.º 2
0
        private ISupportedImageFormat GetFormat(string extension, ImageInstruction ins)
        {
            ISupportedImageFormat format = null;
            
            if (extension.Equals(".jpg", StringComparison.OrdinalIgnoreCase) || extension.Equals(".jpeg", StringComparison.OrdinalIgnoreCase))
                format = new JpegFormat { Quality = ins.JpegQuality };
            else
                if (extension.Equals(".gif", StringComparison.OrdinalIgnoreCase))
                format = new GifFormat { };
            else if (extension.Equals(".png", StringComparison.OrdinalIgnoreCase))
                format = new PngFormat { };

            return format;
        }
Ejemplo n.º 3
0
 public void GetGif()
 {
     var expected = new GifFormat();
     var i = new Imaging();
     foreach (var extension in expected.FileExtensions)
     {
         var format = i.Get(extension);
         Assert.AreEqual(expected.GetType(), format.GetType());
     }
 }