major-mayer / imageconverter

A simple Nextcloud app to convert HEIC/ HEIF images to JPEG
GNU Affero General Public License v3.0
21 stars 2 forks source link

Do not show Option if file is not HEIF / HEIC #9

Closed ErinNoel1 closed 7 months ago

ErinNoel1 commented 1 year ago

Is there a way you could modify this to only give an option to convert if the image selected is HEIC / HEIF format? Currently if I select any image format (JPEG, PNG, etc) the option to convert to JPEG is available. There is an error message if the file is not HEIC / HEIF.

If it were possible, I would rather the option not even show up to users if the file is not able to be converted, to avoid confusion.

major-mayer commented 1 year ago

So at least for a single (!) conversion this should already be the case. The option to convert the file to JPEG should only show up, if the file type is HEIC/ HEIF.

For multiple images, this has not been implemented, mainly because I don't know how it's done. I tried specifying a mime type for my item in OCA.Files.App.fileList.multiSelectMenuItems but this seems to have no effect on the possible options. I could need some help on this, because I don't have time to investigate this further. Do you know of any app that allow doing multi select action based on the file type? This could help greatly.

ErinNoel1 commented 1 year ago

I am not sure. Full disclosure, I am not very familiar with coding or development, so that would be lost on me. I was mainly just asking if you already knew how to implement this possibly, and maybe it was a mild oversight or something.

As far as other apps, I have not explored a ton of them yet as I am in the beginning, testing phases of deploying nextcloud for my company and am still dipping my toes in the water.

I would like to say though, thanks so much for your hard work in developing this app to begin with, it works fantastically from my testing when used as intended :)

ErinNoel1 commented 1 year ago

I will comment that selecting a single jpeg file still seems to show the option to convert to jpeg, which fails with an error message of course.

major-mayer commented 1 year ago

Hi @ErinNoel1 I'm very sorry for the very late response of mine. To be transparent, developing this app any further than keeping it barely working has no priority for me right now, unfortunately. But anyway, thank you very much for your support. I'm glad to hear that it works for you (more or less).

If you select a single JPEG file and then use the "Actions" button (with the three dots), then you are right, the option to convert it to JPEG is still shown. Again, if you find any app that is able to distinguish between different file types for this menu, please give me a heads-up. grafik

But this should not be the case if you open the menu on the file itself: grafik Here you can see that the option to convert the (JPEG) image is not there.

major-mayer commented 7 months ago

This works in version 2.0.0 (compatible only with Nextcloud 28). The option to convert multiple images is not shown when there are non HEIC/HEIF files in the selection.