Skip to content

PhoenixKit 2.21.2: Crop avatars without losing quality

PhoenixKit 2.21.2 adds avatar cropping and protects catalogue files from the orphan file cleanup.

Choosing a new avatar now opens a crop editor before anything is saved. The crop can be moved by dragging and zoomed with the mouse wheel or a Zoom slider; Adjust Crop reopens it later and Reset goes back to the full image. The crop is stored next to the original file instead of being baked into a new image, so cropping again never loses quality. Replacing an avatar clears the old crop, and wide images now look sharp.

The orphan file check did not see images used by catalogue items, categories and catalogues, which keep them inside their data, and could queue a live image for deletion. It now checks those, and protects files of catalogue PDFs too.

Sitemaps for several domains no longer list the same home page twice.

Full release notes: PhoenixKit 2.21.2

2.21.2 · 7 September 2026

Added

  • Non-destructive avatar cropping, Apple Photos style — picking a new avatar opens a drag/wheel/slider crop editor before anything persists; the crop geometry (x, y, zoom, aspect ratio) is stored alongside the original upload rather than baked into re-encoded pixels, so re-cropping never loses quality.

Fixed

  • Multi-domain sitemaps could list the same home URL twice (once bare, once with the full cross-domain hreflang set) when a locale-prefixed clone route had no canonical_path of its own, and a single-language canonical group on a non-primary domain could carry a self-only hreflang pair that the page’s own <head> never backed up.
  • The storage orphan-file check now recognizes catalogue-owned tables: phoenix_kit_cat_items, phoenix_kit_cat_categories, and phoenix_kit_cat_catalogues store image references inside a JSONB data column rather than dedicated FK columns, so a plain join was missing them and could queue a live catalogue image for deletion. phoenix_kit_cat_pdfs references its file through a real FK with ON DELETE RESTRICT; a PDF still in use could have its file data deleted and then crash the cleanup job on the FK violation — that table is now guarded too.
  • A stale avatar crop could outlive the file it was framed for — replacing an avatar without submitting a new crop now clears the old geometry instead of stretching the old aspect ratio onto the new image.
  • Landscape avatars rendered soft: crop-variant selection compared needed pixels against the image’s width instead of its short side, which is what actually bounds sharpness under cover-fit.

PhoenixKit 2.21.2. Install or update: {:phoenix_kit, "~> 2.21"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.