Exemplo n.º 1
0
        public void ThumborVerticalAlign(Thumbor.ImageVerticalAlign align)
        {
            var thumbor    = new Thumbor("http://localhost/");
            var resizedUrl = thumbor.BuildImage("http://localhost/image.jpg")
                             .VerticalAlign(align)
                             .ToFullUrl();

            resizedUrl.Should().Be(string.Format("http://localhost/unsafe/{0}/http://localhost/image.jpg", align.ToString().ToLower()));
        }
Exemplo n.º 2
0
        public void ThumborVerticalAlignIgnoreFirst(Thumbor.ImageVerticalAlign firstAlign, Thumbor.ImageVerticalAlign secondAlign)
        {
            var thumbor    = new Thumbor("http://localhost/");
            var resizedUrl = thumbor.BuildImage("http://localhost/image.jpg")
                             .VerticalAlign(firstAlign)
                             .VerticalAlign(secondAlign)
                             .ToFullUrl();

            resizedUrl.Should().Be(string.Format("http://localhost/unsafe/{0}http://localhost/image.jpg", secondAlign == Thumbor.ImageVerticalAlign.Middle ? string.Empty : secondAlign.ToString().ToLower() + "/"));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets vertical alignment for the image. See https://github.com/thumbor/thumbor/wiki/Usage#horizontal-align for details.
 /// Can be called multiple times with the last call overriding all previous calls.
 /// </summary>
 /// <param name="align">Value to set the alignment for the image.</param>
 /// <returns>The current thumbor image object.</returns>
 public ThumborImage VerticalAlign(Thumbor.ImageVerticalAlign align)
 {
     this.verticalAlign = align;
     return(this);
 }