ASP.NET Core

Your users upload 12MP phone photos. Your app shouldn't serve them raw.

DEV Community: #aspnetcore Daniel Davis
ASP.NET Core

PicReady, a new .NET 8/9 package, wraps SkiaSharp so upload endpoints can orient, resize, crop and encode photos behind a short fluent API, including byte-size budgets. Its MIT-licensed sibling PicReady.Lite covers plain resizing for teams that do not want a commercial license.

Key points

  • EXIF orientation is applied and metadata stripped by default, so phone photos land upright without GPS tags.
  • MaxBytes searches quality until the output fits a byte budget and throws when even the lowest quality fails.
  • Header caps (16384 px longest side, 80 million pixels, 200 MB input) reject decompression bombs before Skia allocates a bitmap.
  • Free PicReady.Lite is MIT and JPEG/PNG-only; Pro adds WebP, avatars, watermarks, ResizeMany, batch and IFormFile helpers.
  • On a 4-core machine, 1280×720 to 640×360 JPEG took 46.4 ms on .NET 8 and 48.0 ms on .NET 9.
  • HEIC, AVIF, TIFF, animated GIF encoding, lossless WebP and CMYK output are explicitly out of scope.
  • Linux native assets come via SkiaSharp.NativeAssets.Linux.NoDependencies, so Docker builds need no libfontconfig.

Real-world use

  • A public avatar endpoint that must return a square 256px WebP under 100 KB.
  • A product catalog needing 320, 640 and 1280px variants from a single decode.
  • A Linux-hosted API that cannot install ImageMagick or libfontconfig in its container.
  • A batch job turning a folder of camera JPEGs into upright, EXIF-free WebP files.

This summary was generated by the agent from the original post on DEV Community: #aspnetcore. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message