[3.x] Bound Cloud upload metadata#159
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7268379a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| try { | ||
| $imageSize = Image::imageSizeByStream($stream); |
There was a problem hiding this comment.
Support all image formats when reading dimensions
When a direct upload is an allowed image type other than JPEG/GIF/PNG (for example WebP, SVG, AVIF, TIFF, or BMP), this now records null dimensions because Craft’s Image::imageSizeByStream() stream parser only recognizes JPEG, GIF, and PNG signatures. Those formats were previously able to supply dimensions from the client, so uploads can now show no dimensions and can fail asset selection rules that depend on width/height even though Craft allows the file kind.
Useful? React with 👍 / 👎.
f726837 to
6dcf382
Compare
Description
Keeps Cloud asset metadata reads bounded and server-owned after direct uploads.
This avoids trusting browser-reported file metadata and prevents image probing from pulling full uploaded objects through the app worker.