Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Focal points produce different crops on Craft Cloud

Aperta Adatta ai principianti
#207 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Leggi la gestione del punto focale in src/imagetransforms/ImageTransformBehavior.php intorno alle righe 71–74 e confrontala con il comportamento documentato di gravity di Cloudflare. Riproduci il ritaglio quadrato con un punto focale decentrato usando l’esempio live dell’issue o la chiamata indicata asset.getUrl({width: 220, height: 220}). Il lavoro è concluso quando lo stesso asset e la stessa trasformazione producono un’inquadratura coerente con il trasformatore di immagini nativo di Craft.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug repo:cloud
Description

The extension passes an asset’s focal-point coordinates directly to Cloudflare as gravity: {x, y} (here), but Cloudflare’s default coordinate gravity behaves differently from Craft’s native image transforms.

Craft centers the crop around the focal point where the image boundaries allow it. Cloudflare preserves the point’s relative position: a focal point 30% from the left of the original remains 30% from the left of the crop. This means the same asset and transform can produce different framing locally and on Cloud.

Steps to reproduce
  1. Set an off-center focal point on an image.
  2. Generate a square crop using asset.getUrl({width: 220, height: 220}).
  3. Compare the result from Craft’s native image transformer with Craft Cloud.

Live example: https://oli.gd/focal

Using mode: 'box-center' seems to work (third image down), and centers the focal point.

Cloudflare’s behavior is documented here:
https://developers.cloudflare.com/images/optimization/features/#xxy

Lingua principale
PHP
Stelle
5
Fork
0
Merge medio
15m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.