Skip to content

feat: fallback to JPEG for WebP thumbnails - #9

Merged
spiegel-im-spiegel merged 1 commit into
mainfrom
copilot/webp-thumbnail-support
Aug 25, 2026
Merged

spiegel-im-spiegel merged 1 commit into
mainfrom
copilot/webp-thumbnail-support

Conversation

@spiegel-im-spiegel

Copy link
Copy Markdown
Member

Summary

Add WebP input support for DownloadThumbnail by decoding WebP and falling back to JPEG output.

Changes

  • Register WebP decoder import:
    • _ "golang.org/x/image/webp"
  • Update DownloadThumbnail format branch:
    • when decoded format is webp, output extension is .jpg
    • encoder format is set to jpeg
  • Add/adjust tests to verify WebP fallback behavior
  • Update DownloadThumbnail function comment (English) to document current fallback behavior
  • Update module/toolchain and related dependencies in go.mod / go.sum

Validation

  • go test -shuffle on ./...
  • golangci-lint-v2 run --enable gosec --timeout 3m0s ./...

- Treat decoded "webp" input as JPEG output in DownloadThumbnail (use .jpg/.jpeg)
- Add TestDownloadThumbnail_WebPFallbackToJPEG to verify behavior
- Bump module Go version to 1.26 and toolchain to go1.27.0; update golang.org/x/image, x/net, x/text
- Refresh go.sum and dependency.png
@spiegel-im-spiegel
spiegel-im-spiegel merged commit b07d73c into main Aug 25, 2026
4 checks passed
@spiegel-im-spiegel
spiegel-im-spiegel deleted the copilot/webp-thumbnail-support branch August 25, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant