public void ThumborHorizontalAlign(Thumbor.ImageHorizontalAlign align) { var thumbor = new Thumbor("http://localhost/"); var resizedUrl = thumbor.BuildImage("http://localhost/image.jpg") .HorizontalAlign(align) .ToFullUrl(); resizedUrl.Should().Be(string.Format("http://localhost/unsafe/{0}/http://localhost/image.jpg", align.ToString().ToLower())); }
public void ThumborVerticalAlignIgnoreFirst(Thumbor.ImageHorizontalAlign firstAlign, Thumbor.ImageHorizontalAlign secondAlign) { var thumbor = new Thumbor("http://localhost/"); var resizedUrl = thumbor.BuildImage("http://localhost/image.jpg") .HorizontalAlign(firstAlign) .HorizontalAlign(secondAlign) .ToFullUrl(); resizedUrl.Should().Be(string.Format("http://localhost/unsafe/{0}http://localhost/image.jpg", secondAlign == Thumbor.ImageHorizontalAlign.Center ? string.Empty : secondAlign.ToString().ToLower() + "/")); }
/// <summary> /// Sets horizontal 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 HorizontalAlign(Thumbor.ImageHorizontalAlign align) { this.horizontalAlign = align; return(this); }