When using the plugin to transform images, the gravity parameter expected by Cloudflare is not populated as expected.
The Cloudflare Image Optimization documentation requires that the gravity parameter is filled with either auto or a "side", defined like this:
A side ("left", "right", "top", "bottom") or coordinates specified on a scale from 0.0 (top or left) to 1.0 (bottom or right), 0.5 being the center. The X and Y coordinates are separated by lowercase x in the URL format. For example, 0x1 means left and bottom, 0.5x0.5 is the center, 0.5x0.33 is a point in the top third of the image.
The plugin currently sends the value of position from the ImageTransform model to the gravity property. It does not work as the value of position does not match the requirement expected by Cloudflare.
Currently, using the plugin, our images transforms requests return: ERROR 9401: Missing or invalid resizing parameters: gravity keyword is not one of the supported values
There needs to be a transformation done so the value of gravity is computed from position and matches the expected value.
For context, we are storing source assets locally and using a Cloudflare Image volume for the transforms only.
When using the plugin to transform images, the
gravity
parameter expected by Cloudflare is not populated as expected.The Cloudflare Image Optimization documentation requires that the
gravity
parameter is filled with eitherauto
or a "side", defined like this:The plugin currently sends the value of
position
from the ImageTransform model to thegravity
property. It does not work as the value ofposition
does not match the requirement expected by Cloudflare.Currently, using the plugin, our images transforms requests return:
ERROR 9401: Missing or invalid resizing parameters: gravity keyword is not one of the supported values
There needs to be a transformation done so the value of
gravity
is computed fromposition
and matches the expected value.For context, we are storing source assets locally and using a Cloudflare Image volume for the transforms only.