// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) James South. // Licensed under the Apache License, Version 2.0. // // // PostProcesses any image requests within the web application. // Many thanks to Azure Image Optimizer // // -------------------------------------------------------------------------------------------------------------------- using System.Web; [assembly: PreApplicationStartMethod(typeof(ImageProcessor.Web.PostProcessor.ApplicationEvents), "Start")] namespace ImageProcessor.Web.PostProcessor { using ImageProcessor.Web.Helpers; using ImageProcessor.Web.HttpModules; /// /// PostProcesses any image requests within the web application. /// Many thanks to Azure Image Optimizer /// public static class ApplicationEvents { public static void Start() { ImageProcessingModule.OnPostProcessing += PostProcess; } private static async void PostProcess(object sender, PostProcessingEventArgs e) { await PostProcessor.PostProcessImage(e.CachedImagePath); } } }