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())); }
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() + "/")); }
/// <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); }