Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HEIC images #165

Closed
1 of 3 tasks
adripo opened this issue Aug 11, 2024 · 6 comments
Closed
1 of 3 tasks

Support HEIC images #165

adripo opened this issue Aug 11, 2024 · 6 comments
Labels
⬆️ enhancement New feature or request 👷‍♂️ help wanted Extra attention is needed

Comments

@adripo
Copy link

adripo commented Aug 11, 2024

What is the problem you are trying to solve with this feature?

Using HEIC images format

What is the solution you are proposing?

Support HEIC format

What alternatives have you considered?

No response

Additional context

No response

Contributions

  • I have searched through existing issues and feature requests to see if my idea has already been proposed.
  • If this feature is accepted, I would be willing to help implement and maintain this feature.
  • If this feature is accepted, I'm willing to sponsor the development of this feature.
@tankerkiller125
Copy link
Contributor

What part of the application doesn't support HEIC? What isn't working? etc.

This request right now is so vague I wouldn't know where to start to even consider fixing it. Further details are required.

@101br03k
Copy link
Contributor

101br03k commented Aug 17, 2024

What I have found using the images from https://filesamples.com/formats/heic
The images open normaly on my computer
image
image

@tankerkiller125
Copy link
Contributor

tankerkiller125 commented Aug 17, 2024

Doing some quick research this isn't something we are really in control of unless we convert the files. Digging into the code we simply spit out whatever was given to us into the HTML img tags.

Browser support is limited: https://caniuse.com/heif (apple safari only)

@101br03k
Copy link
Contributor

@adripo I don't know if youre in a postiton to check if it works wit safari, but it is currently browser limited unless you convert the images (which can be done very easy using a selfhosted instance of convertX )
Unless you have any ideeas I think the issue can be closed but I will leave that up to the issue creator or repo maintainer.

@adripo
Copy link
Author

adripo commented Aug 30, 2024

Apologies for the delayed response. The issue I wanted to highlight is the same one mentioned by @101br03k, where item photos and covers are not visible if the images are in HEIF format. I haven't been able to test this on Safari, but it seems likely that browser limitations are causing the problem.

While I could convert the images before uploading, it's not feasible when capturing pictures directly from the browser during item creation in Homebox. The ideal solution, in my view, would be for Homebox to automatically convert all photos to a widely compatible format like WebP during the upload process. Is this something you can implement and add to the backlog?

@katosdev katosdev added ⬆️ enhancement New feature or request 👷‍♂️ help wanted Extra attention is needed labels Sep 13, 2024
@mcarbonne
Copy link
Contributor

mcarbonne commented Sep 15, 2024

Maybe an alternative is to only accept widely supported image formats on the input form:

diff --git a/frontend/components/Item/CreateModal.vue b/frontend/components/Item/CreateModal.vue
index 24e4f7a..ff40a7a 100644
--- a/frontend/components/Item/CreateModal.vue
+++ b/frontend/components/Item/CreateModal.vue
@@ -11,7 +11,7 @@
         <div class="flex justify-center">
           <div>
             <label for="photo" class="btn">{{ $t("components.item.create_modal.photo_button") }}</label>
-            <input id="photo" type="file" accept="image/*" style="visibility: hidden" @change="previewImage" />
+            <input id="photo" type="file" accept="image/png,image/jpeg,image/gif" style="visibility: hidden" @change="previewImage" />
           </div>
           <BaseButton class="rounded-r-none" :loading="loading" type="submit">
             <template #icon>

I don't have any apple devices so I can't test it, but according to this, it is supposed to work.

EDIT : I opened a PR #227. I tested only non-regression, but as I don't own any apple devices, @adripo your help is welcome to confirm the fix is working !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ enhancement New feature or request 👷‍♂️ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants