public ImageHandler(string baseRoute, IImageCache cache, IImageLoader[] loaders, Func<Type, string, object> convert = null, params Type[] declaredTypes)
        {
            if (loaders == null) throw new ArgumentNullException(nameof(loaders));

            baseRoute = baseRoute ?? "";
            if (baseRoute != "" && !baseRoute.EndsWith("/")) baseRoute += "/";

            this.baseRoute = "/" + baseRoute;
            this.cache = cache;
            this.loaders = loaders.ToArray();
            this.invoker = new ExtensionMethodInvoker(convert, new[] { typeof(ImageFiltering) }.Concat(declaredTypes).ToArray());

            Image.MaxWidth = Image.MaxHeight = 5000;
        }
Exemple #2
0
        public ImageHandler(string baseRoute, IImageCache cache, IImageLoader[] loaders, Func <Type, string, object> convert = null, params Type[] declaredTypes)
        {
            if (loaders == null)
            {
                throw new ArgumentNullException(nameof(loaders));
            }

            baseRoute = baseRoute ?? "";
            if (baseRoute != "" && !baseRoute.EndsWith("/"))
            {
                baseRoute += "/";
            }

            this.baseRoute = "/" + baseRoute;
            this.cache     = cache;
            this.loaders   = loaders.ToArray();
            this.invoker   = new ExtensionMethodInvoker(convert, new[] { typeof(ImageFiltering) }.Concat(declaredTypes).ToArray());

            Image.MaxWidth = Image.MaxHeight = 5000;
        }