PhoenixKit 2.56.0: Crops around the subject, and visitor addresses behind proxies
PhoenixKit 2.56.0 crops fixed-size renditions around a photo’s subject instead of its middle, makes video renditions follow their own settings, and reads the visitor’s address behind proxies such as Caddy.
Crop around the subject
The rendition form has a Crop choice for a fixed box: Around the middle, as before, or Around the subject. The subject is found once per photo with libvips’ attention model, through the optional vix package (add {:vix, "~> 0.42"}), and every cropped rendition of the photo uses the same point. A point a person chose is never replaced. Without vix the crop stays in the middle. The External libraries tab lists libvips.
A rendition that keeps proportions can now fix its height instead of its width (Fixed side), for horizontal panoramas and rows of photos.
Rendition profiles
Rendition sets are now called rendition profiles, like storage profiles: the tab is Rendition profiles and the button New rendition profile. The table says what a size means, such as “300 px wide” with the height following the image, and the mode badges read Keeps proportions and Fixed size.
Video renditions follow their row
The generator ignored the size and quality set for 360p, 720p, 1080p and video_thumbnail, and stretched other video sizes. Now width or a fitting box is applied as configured, a video is never stretched or enlarged, and the quality is the CRF you set.
Visitor addresses behind proxies
Proxies like Caddy send the visitor’s address with a port, which PhoenixKit could not read, so every visitor had the proxy’s address in rate limits, login attempts, the website-access lockout and sessions. The port is now dropped, and IPv4-mapped addresses such as ::ffff:a.b.c.d read as a.b.c.d. Existing sessions move to the visitor’s address once, quietly.
Upgrading
Run mix phoenix_kit.update for V210 and V211; no existing rendition is remade. Before deploying behind such a proxy, replace website-access allowed addresses written as the proxy’s with the visitors’ public addresses, and write ::ffff:a.b.c.d entries as a.b.c.d. Each user’s first sign-in records a new device, without an email. Seeded 720p and 1080p renditions now really use CRF 28; set them to 25 and 23 on the Renditions tab to keep their old quality.
Full release notes: PhoenixKit 2.56.0
2.56.0 · 7 October 2026
Added
-
A fixed image rendition can crop around the subject of the photo, not just its middle. The rendition form has a Crop choice for a fixed box (“Around the middle” as before, or “Around the subject”). The subject is found with libvips’ attention model on a 512 px copy (the optional
vixpackage, which bundles libvips: add{:vix, "~> 0.42"}to the host), stored with the photo (Storage.FocalPoint, inmetadata["focal"], a person’s choice never replaced by detection), and every cropped rendition of the photo uses the same point. Withoutvix, or for a photo with nothing that draws the eye, the crop stays at the middle. Orientation is respected. New columncrop_mode(V210); no existing rendition is remade. -
A rendition that keeps proportions can fix its height instead of its width, for horizontal panoramas and rows of photos: “Fixed side” in the rendition form, “240 px tall · width follows the image” in the table. A vertical panorama already worked with a fixed width. New column
fit_by(V211); no existing rendition is remade, and the standard sizes keep fixing their width. -
The External libraries tab lists libvips, with why it is there (finding the subject of a photo), how it is used (only for renditions cropped around the subject, once per photo), what happens without it (the crop stays at the middle) and, when it is missing, how to enable it (add
vixto the app). It is found through thevixpackage, not thePATH, and the page’s “not found” notice mentions it only once a rendition actually crops around the subject.
Fixed
- A see-through image was not recognised on ImageMagick 7.1.1.
identifynow prints a channel count after the colour model (graya 3.0), which the transparency check read as “no alpha”, so a PNG with transparency got a flat-background JPEG rendition. Only the model is read now.
Changed
-
A rendition set is now a “rendition profile”, like a storage profile. Both are a named bundle a library picks once, when it is created, so both now say “profile”: the tab is Rendition profiles (beside Storage profiles), the button is “New rendition profile”, and the library form and page say “Rendition profile”. Where a sentence said just “the profile”, it now says “storage profile” or “rendition profile”. The Renditions tab also opens its name form only after “New rendition profile” is pressed, like the Libraries and Storage profiles tabs, instead of showing it all the time. Code names (
VariantSet,variant_set_uuid), URLs and stored data are unchanged; history entries written before this say “rendition set” for deep zoom’s default. -
The Renditions tab says what an image rendition’s size means. The Dimensions column read just “300px”; it now says “300 px wide” with “height follows the image” under it, or “150 × 150 px” with “cropped to fit”, the Mode badges read “Keeps proportions” and “Fixed size”, and a legend under the image table adds that a rendition never enlarges an image. A video rendition shows its configured numbers without a claim about how they are applied.
Fixed
-
A video rendition now follows its own row. The generator ignored the configured size and quality of
360p,720p,1080pandvideo_thumbnail(they were fixed at 640x360, 1280x720, 1920x1080 and 640x360, at CRF 28, 25 and 23), and scaled any other video rendition to exactly its width and height, stretching a video of another shape, at a CRF wrongly mapped from the 1-100 image scale. Now a rendition that keeps proportions sets the width and the height follows the video, a fixed one is a box the video is scaled to fit inside (never cropped or stretched), neither enlarges a video, and the quality is the CRF you set (VP9webmgets-b:v 0beside it). A still-frame rendition (the video thumbnail) uses the 1-100 scale whatever it is called. The Renditions tab says what each mode does for video, with a legend. -
Behind a proxy that writes the port, the visitor’s address is now read. Caddy’s
{remote}(and any proxy like it) sendsX-Forwarded-For: 203.0.113.7:28858and[2001:db8::7]:28858;IpAddresscould not parse that and fell back to the proxy’s own address — one address for every visitor in rate limits, login attempts, the website-access lockout, sessions and the “new device” check.client_address/1,client_address_from_socket/1and everything built on them now drop the port froma.b.c.d:portand[v6]:port(a bare IPv6 address is never cut:2001:db8::1:443is an address), and they andextract_ip_address/1report an IPv4-mapped::ffff:a.b.c.dasa.b.c.d. Which header is trusted is unchanged. -
A session stored with the proxy’s address moves to the visitor’s once, quietly. Without this, every session signed in before the fix would read as “changed IP” on every request, and strict fingerprinting would sign them all out. A token whose stored address is loopback/private, used by the same browser from a public address through the proxy (the request’s peer is loopback/private), is rebound to that address on its next request — no warning, no refusal — and checked as usual from then on. A user agent is easy to copy, so this is a one-off loosening of strict mode, not a check: what bounds it is that a session stored with a private/loopback address, used again through a private peer (a proxy) from a public address, moves once — a LAN client that signed in through the same proxy included. A request straight from a public peer, or from another browser, is not rebound.
Upgrading
-
⚠️ Behind a proxy that writes the port, addresses change from the proxy’s to the visitors’.
WebsiteAccess.AllowedAddressescompares exactly: an allowed address written as the proxy’s (172.18.0.8) stops matching — list the visitors’ public addresses instead, before deploying. Existing sessions move to the visitor’s address by themselves (above). The first sign-in of each user after the upgrade is a known browser on a new address, so it records a device and auser.new_login_detectedactivity entry, but sends no “new login” email or notification (that needs a browser the account has not used before). Failed website-access attempts counted against the proxy’s address no longer count towards anyone’s lockout. -
⚠️ On a dual-stack listener, IPv4 visitors change from
::ffff:a.b.c.dtoa.b.c.d— with or without a proxy. An allowed address written as::ffff:a.b.c.dmust be written asa.b.c.d; each user’s first sign-in records a new device row (no email, as above); and the website-access lockout counts exact addresses, so failed attempts recorded as::ffff:a.b.c.dbefore the upgrade stop counting. -
The standard video renditions’ quality now applies. The seeded rows all say CRF 28, so on an existing install
720pand1080pwill be encoded at 28 from now on, where they had been at 25 and 23. To keep that quality, set them to 25 and 23 on the Renditions tab (new installs and “Reset to Defaults” are seeded that way). Videos already made are not remade by this change.
i18n
- Translations for the video rendition wording, in all shipped locales.
- Translations for the rendition profile wording, in all shipped locales.
PhoenixKit 2.56.0. Install or update: {:phoenix_kit, "~> 2.56"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.