/// <summary> /// Applies a url modifier for use with the S3Reader plugin. /// For more information see http://imageresizing.net/plugins/s3reader. /// </summary> /// <param name="urlBuilder">The <see cref="ImageUrlBuilder"/> instance to apply the modifier to.</param> /// <param name="prefix"> /// The virtual folder that all buckets can be accessed under. Defaults to "s3" /// This should match the prefix setting of the plugin defined in web.config. /// </param> /// <param name="bucketName"> /// An optional bucket name. If no name is specified the container is inferred from the image path's root directory. /// </param> public static ImageUrlBuilder FromS3(this ImageUrlBuilder urlBuilder, string prefix = "s3", string bucketName = null) { urlBuilder.AddModifier(s => PathUtils.ModifyPath(s, prefix, bucketName)); return urlBuilder; }
/// <summary> /// Applies a url modifier for use with the AzureReader plugin. /// For more information see http://imageresizing.net/plugins/azurereader. /// </summary> /// <param name="urlBuilder">The <see cref="ImageUrlBuilder"/> instance to apply the modifier to.</param> /// <param name="prefix"> /// The virtual folder that all blobs can be accessed under. Defaults to "azure". /// This should match the prefix setting of the plugin defined in web.config. /// </param> /// <param name="container"> /// An optional container name. If no name is specified the container is inferred from the image path's root directory. /// </param> public static ImageUrlBuilder FromAzure(this ImageUrlBuilder urlBuilder, string prefix = "azure", string container = null) { urlBuilder.AddModifier(s => PathUtils.ModifyPath(s, prefix, container)); return urlBuilder; }
/// <summary> /// Applies a url modifier for use with the remote reader plugin. /// This modifier requires that the urls you pass to the builder are absolute e.g. http://somedomain.com/image.jpg /// For more information see http://imageresizing.net/plugins/remotereader. /// </summary> /// <param name="urlBuilder">The <see cref="ImageUrlBuilder"/> instance to apply the modifier to.</param> /// <returns></returns> public static ImageUrlBuilder FromRemote(this ImageUrlBuilder builder) { builder.AddModifier(s => CreateRemoteUrl(s)); return builder; }
/// <summary> /// Converts the generated urls to lower case /// </summary> public static ImageUrlBuilder LowerCase(this ImageUrlBuilder builder) { return builder.AddModifier(s => s.ToLowerInvariant()); }