Skip to content

[Images] Document text overlays and binding updates - #32883

Open
deannalam wants to merge 1 commit into
productionfrom
deanna/text-overlays
Open

[Images] Document text overlays and binding updates#32883
deannalam wants to merge 1 commit into
productionfrom
deanna/text-overlays

Conversation

@deannalam

Copy link
Copy Markdown
Contributor

Summary

Documents new capabilities for the Images binding: text rasterization and overlays, metadata filtering, support for signed URLs and Direct Creator Upload URLs, and custom response headers.

Changes

Structural changes

  • Remove the duplicate draw-overlays.mdx from optimization/transformations/.

Updated content

  • optimization/binding.mdx — Documented the .text() method for rasterizing text into an image, and the headers option on .response() for setting Cache-Control and other headers without rebuilding the Response.
  • optimization/draw-overlays.mdx — Documented how text overlays work with both cf.image (via text entries in the draw array) and the Images binding (via .text()), and split the url/text/width and height options to distinguish image versus text overlays.
  • storage/binding.mdx — Documented .image(id).signedUrl() for signing private image URLs, .createDirectUpload() for creating Direct Creator Upload links, and the metadataFilter option on .list() for filtering hosted images by custom metadata.

Changelog

  • Added a changelog entry announcing text rasterization and the binding updates (dated 2026-08-24).

@deannalam
deannalam requested review from a team, dochne and renandincer as code owners August 20, 2026 11:19
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 9 warnings found in commit b5610c1.

👉 Fix in your agent 👈
Fix the following review findings in PR #32883 (https://github.com/cloudflare/cloudflare-docs/pull/32883).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Code Review

### Warnings (2)

#### CR-1c273c9e4bf5 · Unchecked nullable stream passed to Images input
- **File:** `src/content/docs/images/optimization/binding.mdx` line 114
- **Issue:** The `.input(response.body)` example feeds `fetch()`'s `response.body` directly into `env.IMAGES.input()`. `Response.body` can be `null`, and the fetch can fail, so this can crash or fail TypeScript strictness.
- **Fix:** Check the fetch result before using it, e.g. `if (!response.ok || !response.body) return new Response("Failed to load image", { status: 502 });`.

#### CR-5ede327a2040 · Unchecked nullable stream from `.bytes()`
- **File:** `src/content/docs/images/optimization/binding.mdx` line 164
- **Issue:** The example passes `env.IMAGES.hosted.image("IMAGE_ID").bytes()` directly to `.input()`, but `.bytes()` returns `ReadableStream | null` when the image is not found.
- **Fix:** Guard against a missing image before calling `.input()`, matching the storage binding docs: `if (!bytes) return new Response("Not found", { status: 404 });`.

---

## Style Guide Review

### Warnings (7)

#### SG-28987037901a · Use Markdown image syntax for content images
- **File:** `src/content/docs/images/optimization/draw-overlays.mdx` line 177
- **Issue:** Adds a raw `<img>` tag to embed the composite=over example image
- **Fix:** Use Markdown image syntax: `![composite=over output](~/assets/images/images/examples/composite/over.png)`

#### SG-b7390a20d31d · Use Markdown image syntax for content images
- **File:** `src/content/docs/images/optimization/draw-overlays.mdx` line 195
- **Issue:** Adds a raw `<img>` tag to embed the composite=in example image
- **Fix:** Use Markdown image syntax: `![composite=in output](~/assets/images/images/examples/composite/in.png)`

#### SG-9530aba7444b · Use Markdown image syntax for content images
- **File:** `src/content/docs/images/optimization/draw-overlays.mdx` line 205
- **Issue:** Adds a raw `<img>` tag to embed the composite=out example image
- **Fix:** Use Markdown image syntax: `![composite=out output](~/assets/images/images/examples/composite/out.png)`

#### SG-8f638c458583 · Use Markdown image syntax for content images
- **File:** `src/content/docs/images/optimization/draw-overlays.mdx` line 215
- **Issue:** Adds a raw `<img>` tag to embed the composite=xor example image
- **Fix:** Use Markdown image syntax: `![composite=xor output](~/assets/images/images/examples/composite/xor.png)`

#### SG-a43f7858bd68 · Use Markdown image syntax for content images
- **File:** `src/content/docs/images/optimization/draw-overlays.mdx` line 225
- **Issue:** Adds a raw `<img>` tag to embed the composite=lighter example image
- **Fix:** Use Markdown image syntax: `![composite=lighter output](~/assets/images/images/examples/composite/lighter.png)`

#### SG-5c2e3ca49af1 · Contractions
- **File:** `src/content/changelog/images/2026-08-24-images-binding-updates.mdx` line 10
- **Issue:** Added line uses the contractions "We've" and "what's" in body prose.
- **Fix:** Rewrite without contractions, for example: "We have added more ways... Here is what is new:"

#### SG-f94a523cdecc · Contractions
- **File:** `src/content/changelog/images/2026-08-24-images-binding-updates.mdx` line 27
- **Issue:** Added line uses the contraction "can't" in body prose.
- **Fix:** Replace "can't" with "cannot".

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (2)
File Issue
images/optimization/binding.mdx line 114 Unchecked nullable stream passed to Images input — The .input(response.body) example feeds fetch()'s response.body directly into env.IMAGES.input(). Response.body can be null, and the fetch can fail, so this can crash or fail TypeScript strictness. Fix: Check the fetch result before using it, e.g. if (!response.ok || !response.body) return new Response("Failed to load image", { status: 502 });.
images/optimization/binding.mdx line 164 Unchecked nullable stream from .bytes() — The example passes env.IMAGES.hosted.image("IMAGE_ID").bytes() directly to .input(), but .bytes() returns ReadableStream | null when the image is not found. Fix: Guard against a missing image before calling .input(), matching the storage binding docs: if (!bytes) return new Response("Not found", { status: 404 });.

Conventions

No convention issues found.

Style Guide Review

Warnings (7)
File Issue
images/optimization/draw-overlays.mdx line 177 Use Markdown image syntax for content images — Adds a raw <img> tag to embed the composite=over example image Fix: Use Markdown image syntax: ![composite=over output](~/assets/images/images/examples/composite/over.png)
images/optimization/draw-overlays.mdx line 195 Use Markdown image syntax for content images — Adds a raw <img> tag to embed the composite=in example image Fix: Use Markdown image syntax: ![composite=in output](~/assets/images/images/examples/composite/in.png)
images/optimization/draw-overlays.mdx line 205 Use Markdown image syntax for content images — Adds a raw <img> tag to embed the composite=out example image Fix: Use Markdown image syntax: ![composite=out output](~/assets/images/images/examples/composite/out.png)
images/optimization/draw-overlays.mdx line 215 Use Markdown image syntax for content images — Adds a raw <img> tag to embed the composite=xor example image Fix: Use Markdown image syntax: ![composite=xor output](~/assets/images/images/examples/composite/xor.png)
images/optimization/draw-overlays.mdx line 225 Use Markdown image syntax for content images — Adds a raw <img> tag to embed the composite=lighter example image Fix: Use Markdown image syntax: ![composite=lighter output](~/assets/images/images/examples/composite/lighter.png)
changelog/images/2026-08-24-images-binding-updates.mdx line 10 Contractions — Added line uses the contractions "We've" and "what's" in body prose. Fix: Rewrite without contractions, for example: "We have added more ways... Here is what is new:"
changelog/images/2026-08-24-images-binding-updates.mdx line 27 Contractions — Added line uses the contraction "can't" in body prose. Fix: Replace "can't" with "cannot".
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@github-actions

Copy link
Copy Markdown
Contributor

This PR changes current filenames or deletes current files. Make sure you have redirects set up to cover the following paths:

  • /images/optimization/transformations/draw-overlays/

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/docs/images/ @cloudflare/product-owners, @renandincer, @third774, @deannalam, @dochne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:changelog product:images Related to Image Resizing product size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants