flowreqop.blogg.se

Tinypng compress
Tinypng compress





tinypng compress

Private void OptimiseImage(ImageData image) If (extension.Equals(".PNG", StringComparison.InvariantCultureIgnoreCase) ||Įxtension.Equals(".JPG", StringComparison.InvariantCultureIgnoreCase)) Var extension = Path.GetExtension(image.Name) Private void Optimise(object sender, ContentEventArgs e) Var contentEvents = () ĬontentEvents.CreatedContent += Optimise Public void Initialize(InitializationEngine context) Public class ImageOptimiseInit : IInitializableModule So this blog shares some code that shows how it's possible to optimise image size on upload using the API: On testing it particularly seems to excel with transparent PNG's. One of best tools around for compressing PNG's is TinyPNG. However, when working on some recent proof of concepts it was noticed that the ImageResizer plugin did not perform too well with transparent PNGs. Episerver already has the awesome ImageResizer plugin for Episerver which can be used to compress and resize images. So it's always recommended that images are optimised. We all know that large image size is a killer for site performance. Using TinyPNG to automatically compress images in Episerver







Tinypng compress