HEIC image support #6507

Closed
opened 2025-12-29 19:41:42 +01:00 by adam · 9 comments
Owner

Originally created by @wreiske on GitHub (May 23, 2022).

Originally assigned to: @bigcat88 on GitHub.

NetBox version

v2.9.8

Feature type

Change to existing functionality

Proposed functionality

Allow support for uploading heic format images to netbox devices.

Use case

Most modern devices (phones, tablets, etc) used by technicians to take photos in the data center / build rooms take pictures in the HEIC format, https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format

By supporting HEIC uploads, it can save a step required to first convert to a JPG or other currently supported file type.

Database changes

No response

External dependencies

Will require convert or imagemagick or another utility to convert the heic to jpg. This can be an optional depdency and only allow heic uploads if imagemagick is available.

Originally created by @wreiske on GitHub (May 23, 2022). Originally assigned to: @bigcat88 on GitHub. ### NetBox version v2.9.8 ### Feature type Change to existing functionality ### Proposed functionality Allow support for uploading heic format images to netbox devices. ### Use case Most modern devices (phones, tablets, etc) used by technicians to take photos in the data center / build rooms take pictures in the HEIC format, https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format By supporting HEIC uploads, it can save a step required to first convert to a JPG or other currently supported file type. ### Database changes _No response_ ### External dependencies Will require `convert` or imagemagick or another utility to convert the heic to jpg. This can be an optional depdency and only allow heic uploads if imagemagick is available.
adam added the status: acceptedtype: feature labels 2025-12-29 19:41:42 +01:00
adam closed this issue 2025-12-29 19:41:42 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 24, 2022):

Support for HEIC is dependent upon Django's ImageField model field.

Will require convert or imagemagick or another utility to convert the heic to jpg. This can be an optional depdency and only allow heic uploads if imagemagick is available.

HEIC format support alone would not justify the introduction of either of these as a new dependency (optional or not). However, the pyheif-pillow-opener seems to add HEIC support for Pillow, which NetBox already uses.

@jeremystretch commented on GitHub (May 24, 2022): Support for HEIC is dependent upon Django's [ImageField](https://docs.djangoproject.com/en/stable/ref/models/fields/#imagefield) model field. > Will require convert or imagemagick or another utility to convert the heic to jpg. This can be an optional depdency and only allow heic uploads if imagemagick is available. HEIC format support alone would not justify the introduction of either of these as a new dependency (optional or not). However, the [pyheif-pillow-opener](https://pypi.org/project/pyheif-pillow-opener/) seems to add HEIC support for Pillow, which NetBox already uses.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 24, 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 (Jul 24, 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

@bigcat88 commented on GitHub (Aug 9, 2022):

HEIC format support alone would not justify the introduction of either of these as a new dependency (optional or not). However, the pyheif-pillow-opener seems to add HEIC support for Pillow, which NetBox already uses.

As alternative, you can take a look at pillow-heif for that.

@bigcat88 commented on GitHub (Aug 9, 2022): > HEIC format support alone would not justify the introduction of either of these as a new dependency (optional or not). However, the [pyheif-pillow-opener](https://pypi.org/project/pyheif-pillow-opener/) seems to add HEIC support for Pillow, which NetBox already uses. As alternative, you can take a look at [pillow-heif](https://github.com/bigcat88/pillow_heif) for that.
Author
Owner

@deridiot commented on GitHub (Sep 4, 2022):

Would certainly appreciate to get that in. Having to convert the images every time is obnoxious. If you don't want to store th images as Geico just convert them on upload. That's a better user experience than denying people to use a widespread image format.

@deridiot commented on GitHub (Sep 4, 2022): Would certainly appreciate to get that in. Having to convert the images every time is obnoxious. If you don't want to store th images as Geico just convert them on upload. That's a better user experience than denying people to use a widespread image format.
Author
Owner

@arthanson commented on GitHub (Sep 7, 2022):

looks like https://github.com/uploadcare/heif-image-plugin/ is the current plugin to use, however quick trial didn't allow uploading of heic image from Django...

@arthanson commented on GitHub (Sep 7, 2022): looks like https://github.com/uploadcare/heif-image-plugin/ is the current plugin to use, however quick trial didn't allow uploading of heic image from Django...
Author
Owner

@bigcat88 commented on GitHub (Oct 27, 2022):

If someone still need this I can start making a PR.

@bigcat88 commented on GitHub (Oct 27, 2022): If someone still need this I can start making a PR.
Author
Owner

@jeremystretch commented on GitHub (Nov 4, 2022):

This issue was initially accepted under the premise that merely introducing a dependent image processing library would be sufficient to achieve HEIF support, however as learned in PR #10774 that is unfortunately not the case.

I've discussed this with the other maintainers. Ideally, any support for new image formats should be delivered upstream in Django itself, as this functionality has nothing to do with NetBox itself. We'd also be willing to utilize a third-party replacement for the core ImageField which introduces this support if a strong argument can be made for doing so. However, this isn't something we're willing to own the maintenance of within NetBox itself.

For anyone interested in introducing support for HEIF images, I recommend submitting a feature request to the Django project.

@jeremystretch commented on GitHub (Nov 4, 2022): This issue was initially accepted under the premise that merely introducing a dependent image processing library would be sufficient to achieve HEIF support, however as learned in PR #10774 that is unfortunately not the case. I've discussed this with the other maintainers. Ideally, any support for new image formats should be delivered upstream in Django itself, as this functionality has nothing to do with NetBox itself. We'd also be willing to utilize a third-party replacement for the core ImageField which introduces this support if a strong argument can be made for doing so. However, this isn't something we're willing to own the maintenance of within NetBox itself. For anyone interested in introducing support for HEIF images, I recommend submitting a feature request to [the Django project](https://code.djangoproject.com/).
Author
Owner

@wreiske commented on GitHub (Nov 4, 2022):

@jeremystretch , I respect your decision of maintainability, nevertheless, we still really need this functionality. Is there a plugin system or a way for us to "hook" into this image upload without needing to fork net box and run our own custom build of it?

Another thought is to force jpg or support formats on the file upload, which will allow mobile phones that default to heic to use jpg instead. Looking at the input box, it shows the following output:

<div class="row mb-3">
        <label for="id_image" class="form-label col col-md-3 text-lg-end required">
            Image
        </label>
        <div class="col col-md-9">
            <input type="file" name="image" accept="image/*" class="form-control" placeholder="Image" required="" id="id_image">
        </div>
    </div>

Changing the accept to something like accept="image/png, image/jpeg" and adding a capture tag might allow taking jpg photos right on the phone by clicking the file upload box. No conversion or extra support would need to be added on the server side.

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers

@wreiske commented on GitHub (Nov 4, 2022): @jeremystretch , I respect your decision of maintainability, nevertheless, we still really need this functionality. Is there a plugin system or a way for us to "hook" into this image upload without needing to fork net box and run our own custom build of it? Another thought is to force jpg or support formats on the file upload, which will allow mobile phones that default to heic to use jpg instead. Looking at the input box, it shows the following output: ``` <div class="row mb-3"> <label for="id_image" class="form-label col col-md-3 text-lg-end required"> Image </label> <div class="col col-md-9"> <input type="file" name="image" accept="image/*" class="form-control" placeholder="Image" required="" id="id_image"> </div> </div> ``` Changing the `accept` to something like `accept="image/png, image/jpeg"` and adding a `capture` tag might allow taking jpg photos right on the phone by clicking the file upload box. No conversion or extra support would need to be added on the server side. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers
Author
Owner

@jeremystretch commented on GitHub (Nov 4, 2022):

Is there a plugin system or a way for us to "hook" into this image upload without needing to fork net box and run our own custom build of it?

As I said, if you would like to own the burden of creating, publishing, and maintaining a custom ImageField implementation that includes HEIF support as a separate Django app, we'll consider adopting it.

@jeremystretch commented on GitHub (Nov 4, 2022): > Is there a plugin system or a way for us to "hook" into this image upload without needing to fork net box and run our own custom build of it? As I said, if you would like to own the burden of creating, publishing, and maintaining a custom [ImageField](https://docs.djangoproject.com/en/4.1/ref/models/fields/#imagefield) implementation that includes HEIF support as a separate Django app, we'll consider adopting it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6507