Monorepo for Tangled tangled.org
769
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview,knotserver,camo: add AVIF and modern image format support #251

open opened by overby.me targeting master from overby.me/core: feat/avif-support

Add support for AVIF, JPEG XL, and HEIF image formats across the stack. Currently these formats fail at three points in the rendering pipeline:

  1. Knot server returns 403: http.DetectContentType() in Go doesn't recognize AVIF/JXL/HEIF, returning application/octet-stream, which hits the default case and returns HTTP 403.
  2. Camo proxy returns 415: image/avif, image/jxl, and image/heif are missing from the allowed MIME types list in mimetypes.json.
  3. Blob viewer doesn't render as image: .avif, .jxl, .heic, .heif are missing from the image extension switch in NewBlobView.

Changes#

  • knotserver/xrpc/repo_blob.go: Replace the single if for .svg with a switch that also overrides MIME types for .avif, .jxl, .heic, .heif
  • camo/src/mimetypes.json: Add image/avif, image/heif, image/jxl to the allowed MIME types list
  • appview/repo/blob.go: Add .avif, .jxl, .heic, .heif to the image extension case in the blob viewer

Reproduction#

Any repo with .avif images in its README, e.g. https://tangled.org/@overby.me/overby-me

AVIF has 97%+ browser support and is increasingly common as a modern replacement for JPEG/PNG/WebP.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:eukcx4amfqmhfrnkix7zwm34/sh.tangled.repo.pull/3mgfgepvxfr22
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
overby.me submitted #0
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments