Skip to content

Commit 67fe09f

Browse files
kay0tickaycaio1516
andauthored
Clarify image formats and size in media plugin and forms (#42)
## 📜 Details - Explicitly state devvit supports data URLs and WEBPs. - Add supported formats and size limit to the image field in forms ## 🧪 Testing Steps / Validation Tested with `yarn start` **Image docs:** <img width="915" height="247" alt="Screenshot 2026-02-03 at 4 35 13 PM" src="https://github.com/user-attachments/assets/a7a69279-bd52-454a-b151-19883acd9866" /> **Forms docs:** <img width="915" height="164" alt="Screenshot 2026-02-03 at 4 36 03 PM" src="https://github.com/user-attachments/assets/6cbd9a29-0750-4609-bea7-8b4afc54c154" /> ## ✅ Checks <!-- Make sure your pr passes the CI checks and do check the following fields as needed - --> - [ ] CI tests (if present) are passing - [ ] Adheres to code style for repo - [ ] Contributor License Agreement (CLA) completed if not a Reddit employee --------- Co-authored-by: Caio Araujo <[email protected]>
1 parent 2988932 commit 67fe09f

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

docs/capabilities/client/forms.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,12 @@ const imageField = {
511511
| `placeholder` | `string` `undefined` | Placeholder text for display before a value is present. |
512512
| `isSecret` | `boolean` `undefined` | Makes the form field secret. |
513513

514+
#### Notes
515+
516+
- The formats supported are PNG, JPEG, WEBP, and GIF.
517+
- The maximum file size allowed is 20 MB.
518+
- When uploading a WEBP image, it will be converted to JPEG. As such, the Reddit URL returned points to a JPEG image.
519+
514520
### Group
515521

516522
A collection of related fields that allows for better readability.

docs/capabilities/server/media-uploads.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Enable the `media` permission in your `devvit.json` file.
2222
```
2323

2424
## Using media uploads
25-
On the server, you can pass the URL of any remotely hosted image (even if its not hosted on Reddit) to the `media.upload` function. The media function will return a Reddit URL.
25+
On the server, you can pass the URL of any remotely hosted image (even if its not hosted on Reddit) to the `media.upload` function. This function will return a Reddit URL. Both HTTP and data URLs are supported.
2626

2727
<Tabs>
2828
<TabItem value="web" label="Devvit Web">
@@ -50,9 +50,10 @@ On the server, you can pass the URL of any remotely hosted image (even if its no
5050

5151

5252
## Limitations
53-
Supported file types are:
54-
- GIF
55-
- PNG
56-
- JPEG
5753

58-
Maximum size is 20 MB.
54+
- The formats supported are PNG, JPEG, WEBP, and GIF.
55+
- The maximum file size allowed is 20 MB.
56+
57+
### Notes
58+
59+
- When uploading a WEBP image, it will be converted to JPEG. As such, the Reddit URL returned points to a JPEG image.

versioned_docs/version-0.12/capabilities/client/forms.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,12 @@ const imageField = {
511511
| `placeholder` | `string` `undefined` | Placeholder text for display before a value is present. |
512512
| `isSecret` | `boolean` `undefined` | Makes the form field secret. |
513513

514+
#### Notes
515+
516+
- The formats supported are PNG, JPEG, WEBP, and GIF.
517+
- The maximum file size allowed is 20 MB.
518+
- When uploading a WEBP image, it will be converted to JPEG. As such, the Reddit URL returned points to a JPEG image.
519+
514520
### Group
515521

516522
A collection of related fields that allows for better readability.

versioned_docs/version-0.12/capabilities/server/media-uploads.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Enable the `media` permission in your `devvit.json` file.
2222
```
2323

2424
## Using media uploads
25-
On the server, you can pass the URL of any remotely hosted image (even if its not hosted on Reddit) to the `media.upload` function. The media function will return a Reddit URL.
25+
On the server, you can pass the URL of any remotely hosted image (even if its not hosted on Reddit) to the `media.upload` function. This function will return a Reddit URL. Both HTTP and data URLs are supported.
2626

2727
<Tabs>
2828
<TabItem value="web" label="Devvit Web">
@@ -50,9 +50,10 @@ On the server, you can pass the URL of any remotely hosted image (even if its no
5050

5151

5252
## Limitations
53-
Supported file types are:
54-
- GIF
55-
- PNG
56-
- JPEG
5753

58-
Maximum size is 20 MB.
54+
- The formats supported are PNG, JPEG, WEBP, and GIF.
55+
- The maximum file size allowed is 20 MB.
56+
57+
### Notes
58+
59+
- When uploading a WEBP image, it will be converted to JPEG. As such, the Reddit URL returned points to a JPEG image.

0 commit comments

Comments
 (0)