Skip to content

Profile image processing ​

GrydAuth Infrastructure decodes profile images with SkiaSharp 4.153.1 and stores four WebP variants with maximum edges of 64, 128, 256, and 512 pixels. Aspect ratio is preserved, smaller inputs are enlarged to the requested edge, and WebP quality is 85. The original upload result reports image/webp, matching the stored bytes.

The service accepts JPEG/JPG, PNG, GIF, and WebP input up to 5 MiB; it reads at most one additional byte to reject oversized non-seekable streams. Images must be from 32 through 2048 pixels per edge, and dimensions are inspected before allocating decoded pixels. Animations are limited to 100 frames and 8,388,608 decoded source pixels. Each resized variant also has an 8,388,608-pixel budget across all its frames; the largest variant is checked before any resize allocation. Frame content, durations, and repeat count are retained in animated WebP output, including single-play, finite-repeat, and infinite animations. SkiaSharp exposes repetition count separately, so the service writes the equivalent WebP loop count into its own encoded output; repeat counts above 65,534 are rejected because they exceed WebP's 16-bit loop field. JPEG EXIF orientation is applied to the pixels before resizing, including mirrored and transposed orientations; validation continues to report the encoded width and height. Output is encoded with neutral orientation and does not copy EXIF or other source metadata. Zero-length frame durations are normalized to one millisecond.

SkiaSharp needs its native library at runtime. The SkiaSharp package carries it for Windows and macOS; for Linux, GrydAuth.Infrastructure itself depends on SkiaSharp.NativeAssets.Linux.NoDependencies at the same version, so libSkiaSharp reaches every application through the package and a host references nothing extra. Until 7.1.0 each host had to add that reference; one that did not failed on the first upload. A host that needs a different SkiaSharp native variant can exclude this one with ExcludeAssets on the package and bring its own.

When the library cannot be loaded anyway (a host that excludes runtime or native assets, or a platform SkiaSharp ships no binary for), the host still starts and logs a critical entry at startup, and uploads answer 503 PROFILE_PICTURE_PROCESSING_UNAVAILABLE instead of reporting the file as an invalid image. See the upstream native package guidance and the SkiaSharp license.

This migration removes SixLabors.ImageSharp from the Auth Infrastructure dependency graph following the ImageSharp 3.1.11 security advisories. The replacement is an API and implementation migration; it does not claim that changing image libraries fixes every issue described by those advisories. See the ImageSharp security advisories and the SkiaSharp 4.153.1 release.

Released under the MIT License.