blog/source/_posts/2024-10-07.md

7 lines
954 B
Markdown

---
title: Image resizing/transformation in Cloudflare Pages Functions
date: 2024-10-07
---
Cloudflare [Pages Functions](https://developers.cloudflare.com/pages/functions/) does not support Cloudflare Images [resizing/transformation](https://developers.cloudflare.com/images/transform-images/) either [directly](https://community.cloudflare.com/t/cloudflare-page-functions-and-image-resizing-not-working/637535) or through a Worker via [service binding](https://gitlab.com/curben/blog/-/blob/fd4c2043a6cdbe34a97b2b31e73b5e9f6e8eb32e/functions/images/%5B%5Bcatchall%5D%5D.js#L13). Instead, [`fetch()`](https://gitlab.com/curben/blog/-/blob/a6a43877763deaff99d369d513338456af9b31d9/functions/images/%5B%5Bcatchall%5D%5D.js) from a [Worker](https://gitlab.com/curben/blog/-/blob/fd4c2043a6cdbe34a97b2b31e73b5e9f6e8eb32e/cf-images/index.js) through a [route](https://gitlab.com/curben/blog/-/blob/3fc28281b232be917c4970318591656db52d4ac3/wrangler.toml#L7).