Support WebP format image uploads #4990

Closed
opened 2025-12-29 19:22:57 +01:00 by adam · 3 comments
Owner

Originally created by @fknorn on GitHub (Jun 11, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.4

Feature type

Change to existing functionality

Proposed functionality

Currently, image uploads of a range of "classic" image formates are supported (jpg, png, etc.). However, the WebP-format ist missing in that list. Most modern webbrowser support this format natively and its popularity is evergrowing.

Use case

Upload device type images with transparent background

Database changes

None

External dependencies

Not too sure what kind of internal processing is done to the imagery, but any involved libraries would need to support this format.

Originally created by @fknorn on GitHub (Jun 11, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.4 ### Feature type Change to existing functionality ### Proposed functionality Currently, image uploads of a range of "classic" image formates are supported (jpg, png, etc.). However, the WebP-format ist missing in that list. Most modern webbrowser [support this format natively](https://caniuse.com/webp) and its popularity is evergrowing. ### Use case Upload device type images with transparent background ### Database changes None ### External dependencies Not too sure what kind of internal processing is done to the imagery, but any involved libraries would need to support this format.
adam added the status: acceptedtype: feature labels 2025-12-29 19:22:57 +01:00
adam closed this issue 2025-12-29 19:22:57 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 11, 2021):

NetBox relies on Django's ImageField to model images, which in turn relies on Python's Pillow image processing library. If Pillow and Django support webp images, NetBox should too. However, Pillow's documentation warns:

Pillow reads and writes WebP files. The specifics of Pillow’s capabilities with this format are currently undocumented.

I'll mark this as needs owner for anyone who wants to dig into this.

@jeremystretch commented on GitHub (Jun 11, 2021): NetBox relies on [Django's ImageField](https://docs.djangoproject.com/en/3.2/ref/models/fields/#imagefield) to model images, which in turn relies on Python's [Pillow](https://pillow.readthedocs.io/en/stable/) image processing library. If Pillow and Django support webp images, NetBox should too. However, [Pillow's documentation](https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#webp) warns: > Pillow reads and writes WebP files. The specifics of Pillow’s capabilities with this format are currently undocumented. I'll mark this as `needs owner` for anyone who wants to dig into this.
Author
Owner

@jeremystretch commented on GitHub (Jun 16, 2021):

Seems like all the library support is already there; we just need to add image/webp to the list of accepted image types for DeviceType front and rear images. (Image attachments already support webp files in the current release.)

@jeremystretch commented on GitHub (Jun 16, 2021): Seems like all the library support is already there; we just need to add `image/webp` to the list of accepted image types for DeviceType front and rear images. (Image attachments already support webp files in the current release.)
Author
Owner

@fknorn commented on GitHub (Jun 16, 2021):

Thanks, Jeremy ! Happy summer (at least to all the northern hemispherians :-))

@fknorn commented on GitHub (Jun 16, 2021): Thanks, Jeremy ! Happy summer (at least to all the northern hemispherians :-))
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4990