From cb6022fc9dd2a443087f657961f4c1648a8f6de2 Mon Sep 17 00:00:00 2001 From: Denise Pena Date: Wed, 23 Oct 2024 15:47:04 -0500 Subject: [PATCH 1/3] Added saturation parameter --- .../transform-images/transform-via-url.mdx | 4 ++++ .../transform-via-workers.mdx | 4 ++++ src/content/partials/images/saturation.mdx | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 src/content/partials/images/saturation.mdx diff --git a/src/content/docs/images/transform-images/transform-via-url.mdx b/src/content/docs/images/transform-images/transform-via-url.mdx index 9fd35e136aa8d99..9c9d29cd9e5ff03 100644 --- a/src/content/docs/images/transform-images/transform-via-url.mdx +++ b/src/content/docs/images/transform-images/transform-via-url.mdx @@ -111,6 +111,10 @@ You must specify at least one option. Options are comma-separated (spaces are no +### `saturation` + + + ### `sharpen` diff --git a/src/content/docs/images/transform-images/transform-via-workers.mdx b/src/content/docs/images/transform-images/transform-via-workers.mdx index 1a511e66fb64267..0a15964202b21ce 100644 --- a/src/content/docs/images/transform-images/transform-via-workers.mdx +++ b/src/content/docs/images/transform-images/transform-via-workers.mdx @@ -98,6 +98,10 @@ The `fetch()` function accepts parameters in the second argument inside the `{cf +### `saturation` + + + ### `sharpen` diff --git a/src/content/partials/images/saturation.mdx b/src/content/partials/images/saturation.mdx new file mode 100644 index 000000000000000..7d82701e88d65a2 --- /dev/null +++ b/src/content/partials/images/saturation.mdx @@ -0,0 +1,19 @@ +--- +{} +--- +import { Tabs, TabItem } from "~/components" + +Increases saturation by a factor. A value of `1.0` equals no change, a value of `0.5` equals half saturation, and a value of `2.0` equals twice as saturated. `0` is ignored. + + + + ```js + saturation=0.5 + ``` + + + ```js + cf: {image: {saturation: 0.5}} + ``` + + \ No newline at end of file From 6112a5fa515ff763c212306a7b4ece46902e19cb Mon Sep 17 00:00:00 2001 From: Denise Pena Date: Wed, 23 Oct 2024 15:59:13 -0500 Subject: [PATCH 2/3] Added configure webhooks & added links --- .../manage-images/configure-webhooks.mdx | 20 +++++++++++++++++++ .../upload-images/direct-creator-upload.mdx | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/content/docs/images/manage-images/configure-webhooks.mdx diff --git a/src/content/docs/images/manage-images/configure-webhooks.mdx b/src/content/docs/images/manage-images/configure-webhooks.mdx new file mode 100644 index 000000000000000..4311c25a04e2403 --- /dev/null +++ b/src/content/docs/images/manage-images/configure-webhooks.mdx @@ -0,0 +1,20 @@ +--- +pcx_content_type: how-to +title: Configure webhooks +--- + +You can set up webhooks to receive notifications about your upload workflow. This will send an HTTP POST request to a specified endpoint when an image either successfully uploads or fails to upload. + +Currently, webhooks are supported only for [direct creator uploads](/images/upload-images/direct-creator-upload/). + +To receive notifications for direct creator uploads: + +1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account. +2. Navigate to **Notifications** > **Destinations**. +3. From the Webhooks card, select **Create**. +4. Enter information for your webhook and select **Save and Test**. The new webhook will appear in the **Webhooks** card and can be attached to notifications. +5. Next, navigate to **Notifications** > **All Notifications** and click **Add**. +6. Under the list of products, locate **Images** and select **Select**. +7. Give your notification a name and optional description. +8. Under the **Webhooks** field, select the webhook that you recently created. +9. Click **Save**. diff --git a/src/content/docs/images/upload-images/direct-creator-upload.mdx b/src/content/docs/images/upload-images/direct-creator-upload.mdx index fd3dab3564c044f..4f271a7995fb191 100644 --- a/src/content/docs/images/upload-images/direct-creator-upload.mdx +++ b/src/content/docs/images/upload-images/direct-creator-upload.mdx @@ -1,6 +1,6 @@ --- pcx_content_type: how-to -title: Accept direct creator uploads +title: Direct creator uploads sidebar: order: 5 @@ -8,6 +8,8 @@ sidebar: The Direct Creator Upload feature in Cloudflare Images lets your users upload images with a one-time upload URL without exposing your API key or token to the client. Using a direct creator upload also eliminates the need for an intermediary storage bucket and the storage/egress costs associated with it. +You can set up [webhooks](/images/manage-images/configure-webhooks/) to receive notifications on your direct creator upload workflow. + ## Request a one-time upload URL Make a `POST` request to the `direct_upload` endpoint using the example below as reference. From af6816c5e42ee46ac7e513db4dc42a27f4a83c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denise=20Pe=C3=B1a?= <75506267+dcpena@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:07:54 -0500 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Patricia Santa Ana <103445940+patriciasantaana@users.noreply.github.com> --- .../docs/images/manage-images/configure-webhooks.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/images/manage-images/configure-webhooks.mdx b/src/content/docs/images/manage-images/configure-webhooks.mdx index 4311c25a04e2403..1a4616260397c87 100644 --- a/src/content/docs/images/manage-images/configure-webhooks.mdx +++ b/src/content/docs/images/manage-images/configure-webhooks.mdx @@ -10,11 +10,11 @@ Currently, webhooks are supported only for [direct creator uploads](/images/uplo To receive notifications for direct creator uploads: 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account. -2. Navigate to **Notifications** > **Destinations**. +2. Go to **Notifications** > **Destinations**. 3. From the Webhooks card, select **Create**. 4. Enter information for your webhook and select **Save and Test**. The new webhook will appear in the **Webhooks** card and can be attached to notifications. -5. Next, navigate to **Notifications** > **All Notifications** and click **Add**. +5. Next, go to **Notifications** > **All Notifications** and select **Add**. 6. Under the list of products, locate **Images** and select **Select**. 7. Give your notification a name and optional description. 8. Under the **Webhooks** field, select the webhook that you recently created. -9. Click **Save**. +9. Select **Save**.