public static void FromFabrik(this ImageUrlBuilder builder, ViewHelperConfiguration configuration)
        {
            builder.AddModifier(src => TransformUri(src, configuration.StorageServerUri, configuration.MediaServerUri));

            if (configuration.Version.IsNotNullOrEmpty())
            {
                builder.SetParameter("v", configuration.Version);
            }
        }
 /// <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);
 }
Beispiel #3
0
 /// <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);
 }
Beispiel #4
0
 /// <summary>
 /// Converts the generated urls to lower case
 /// </summary>
 public static ImageUrlBuilder LowerCase(this ImageUrlBuilder builder)
 {
     return(builder.AddModifier(s => s.ToLowerInvariant()));
 }