mirror of
https://github.com/navidrome/navidrome.git
synced 2026-07-09 17:18:45 +00:00
* fix(artwork): convert decoded images to a fast-path type before resizing
x/image/draw's CatmullRom scaler only has optimized paths for *image.RGBA,
*image.NRGBA, *image.Gray and *image.YCbCr. Other concrete types — notably
*image.NYCbCrA (from WebP) and *image.Paletted (indexed PNGs) — fall back to
a generic per-pixel At()/RGBA() loop that is several times slower.
Convert such images to *image.RGBA once before scaling; fast-path types are
returned unchanged. This makes resize performance independent of which decoder
wins the image.Decode("webp") registration, and also speeds up indexed PNGs.
Signed-off-by: Deluan <deluan@navidrome.org>
* chore(deps): update gen2brain/webp to v0.6.0
v0.6.0 replaces the wazero WASM runtime with a self-contained
wasm2go-transpiled WebP decoder/encoder. This drops the webp -> wazero
dependency edge (wazero is still used by the plugin system) and makes the
WASM-only build path (32-bit / nodynamic) faster and far lighter on
allocations.
Signed-off-by: Deluan <deluan@navidrome.org>
* perf(artwork): defer fast-path conversion until a resize is needed
Move toFastScaleType to just before the CatmullRom.Scale call, after the
no-upscale early return. Previously the conversion ran right after decode, so a
request for a size >= the source dimensions would allocate and walk a full RGBA
copy only to discard it when resizeStaticImage returns nil. The resize path is
unchanged; the no-op path drops ~30-40% time and up to ~79% memory for large
indexed/WebP artwork.
Signed-off-by: Deluan <deluan@navidrome.org>
---------
Signed-off-by: Deluan <deluan@navidrome.org>
|
||
|---|---|---|
| .. | ||
| e2e | ||
| animation.go | ||
| animation_test.go | ||
| artwork.go | ||
| artwork_internal_test.go | ||
| artwork_suite_test.go | ||
| artwork_test.go | ||
| benchmark_decode_test.go | ||
| benchmark_e2e_test.go | ||
| benchmark_encode_test.go | ||
| benchmark_helpers_test.go | ||
| benchmark_pipeline_test.go | ||
| benchmark_tag_test.go | ||
| cache_warmer.go | ||
| cache_warmer_test.go | ||
| image_cache.go | ||
| library_fs.go | ||
| library_fs_test.go | ||
| reader_album.go | ||
| reader_album_test.go | ||
| reader_artist.go | ||
| reader_artist_test.go | ||
| reader_disc.go | ||
| reader_disc_test.go | ||
| reader_mediafile.go | ||
| reader_playlist.go | ||
| reader_radio.go | ||
| reader_radio_test.go | ||
| reader_resized.go | ||
| reader_resized_test.go | ||
| sources.go | ||
| sources_internal_test.go | ||
| wire_providers.go | ||