Add svg support for device type pictures #6949

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

Originally created by @PaulR282 on GitHub (Sep 8, 2022).

NetBox version

v3.3.2

Feature type

New functionality

Proposed functionality

It would be nice to have support for .svg files when uploading a picture for a device type.

Use case

You often get vector graphics, like SVG files when downloading pictures of devices. We also youse vector graphics when creating images of devices you can't find online. It would be nice to be able to upload a vector graphic file since the rack view is also rendered as SVG.

Database changes

No response

External dependencies

No response

Originally created by @PaulR282 on GitHub (Sep 8, 2022). ### NetBox version v3.3.2 ### Feature type New functionality ### Proposed functionality It would be nice to have support for .svg files when uploading a picture for a device type. ### Use case You often get vector graphics, like SVG files when downloading pictures of devices. We also youse vector graphics when creating images of devices you can't find online. It would be nice to be able to upload a vector graphic file since the rack view is also rendered as SVG. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurepending closurestatus: under review labels 2025-12-29 19:47:07 +01:00
adam closed this issue 2025-12-29 19:47:07 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 8, 2022):

There are a few considerations with this. The first is that Django's ImageField doesn't support SVG images. We could work around that by switching to a generic FileField, however we lose some of ImageField's convenience.

The other concern would be handling SVG images embedded within a rack elevation, which is itself an SVG image. We currently embed raster images via the <image> element. AFAICT this should work for SVG images as well, though I'm not sure if there are any caveats regarding browser support, etc.

@jeremystretch commented on GitHub (Sep 8, 2022): There are a few considerations with this. The first is that Django's ImageField doesn't support SVG images. We could work around that by switching to a generic FileField, however we lose some of ImageField's convenience. The other concern would be handling SVG images embedded within a rack elevation, which is itself an SVG image. We currently embed raster images via the `<image>` element. AFAICT this should work for SVG images as well, though I'm not sure if there are any caveats regarding browser support, etc.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 8, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Nov 8, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Dec 15, 2022):

Going to punt on this until we have a better idea of how to handle SVG images in general. Definitely seems like something that should be handled either upstream in Django itself, or via a third party library.

@jeremystretch commented on GitHub (Dec 15, 2022): Going to punt on this until we have a better idea of how to handle SVG images in general. Definitely seems like something that should be handled either upstream in Django itself, or via a third party library.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6949