OneFolderApp / OneFolder

File explorer made for pictures
https://onefolder.app
GNU General Public License v3.0
242 stars 13 forks source link

HEIC support #72

Open Antoine-lb opened 9 months ago

Antoine-lb commented 9 months ago

There is more than one way to go about it:

I'm not very educated in the matter, and probably there are more options than that, I'm open for comments

kdjanz commented 9 months ago

I think the rule must be that OneFolder must Never Ever change the user's files without permission. So, you can either just display the HEIC or you can create a temporary JPG to display in the thumbnails - either option would be transparent to the user - we don't know and we don't care.

But if I right click on an image and get the option to "Convert to..." then I am asking you and giving you permission to mess with my files with my knowledge. It must be up to me whether I overwrite the HEIC or just add a duplicate file somewhere else that I can use to share or post or whatever. As part of the Conversion process, it would be nice if you give me the option to delete the duplicated HEIC, but that should not be the default unless the user has set that.

My opinions...

fscheps commented 9 months ago

I think if we can have the option to treat HEIC files the same way JPG files are treated, then everything would work well. I am not sure if HEIC files have the same specs as JPG with tags, keywords and all, then I would love to have tags saved on the file itself so then I could do the categorization work only once and no matter where I import my pics in the future all information would be preserved.

Antoine-lb commented 9 months ago

@kdjanz Fully agree, we should even make it more clear that "OneFolder never modifies your files without confirmation".

For now the converting on the fly to JPEG seems to be the best option, it solves the problem and is not too much work.

The problem can be divided in two:

In the full preview we could use heic2any to convert in the fly, seems straightforward.

The thumbnails may be a harder problem, sharp needs packages installed in the computer in order to work with HEIC, so maybe for a first version not show:

SCR-20240204-jutm
Antoine-lb commented 9 months ago

@fscheps yes it should be the same as JPG in regards of the metadata, because we use ExifTool under the hood and they support it pretty well. Tags should be saved in the file itself.

The problem is how to view those images on the app, because Chromium (like Google Chrome) doesn't support HEIC, and OneFolder being built on top of Chromium we don't support it either (e.g. we can't just display a HEIC the same way we do with PNG, we have to find a work around).

kdjanz commented 9 months ago

I think a reasonable workflow would then be to make a JPEG from the HEIC, then hide the HEIC so that the user doesn’t see duplicates or know that there was a swap. As the user adds tags or info to the JPEG, you silently add the same tags to the HEIC in the background, so that everything is always up to date. Only if the user wanted to post process a file or do something that required highest quality would OneFolder tell the user that the original HEIC was available if they wanted to use that for Edit or Export or Resizing or Conversion or whatever they wanted to do that would be best done using the HEIC original. In most circumstances, the HEIC would just disappear for the user and they could treat it like the rest of their photos. This way, the HEIC would be converted to a full size JPEG just once on import and then the JPEG goes into the usual OneFolder workflow for thumbnails etc just like any other photo.

In settings, there could be an option: “Hide HEIC files after conversion” to control this hiding / cleanup. The settings could also control what format the conversion from HEIC would use - JPEG or PNG or TIFF or whatever. But the defaults would be JPEG and hide the HEIC so that normal operations are transparent to the user, and they never even know that they have HEIC’s on board.

Hope this helps

Kelly Janz

On Feb 4, 2024, at 2:47 AM, Antoine @.***> wrote:

@kdjanz https://github.com/kdjanz Fully agree, we should even make it more clear that "OneFolder never modifies your files without confirmation".

For now the converting on the fly to JPEG seems to be the best option, it solves the problem and is not too much work.

The problem can be divided in two:

Converting the image in the full preview Converting the thumbnails In the full preview we could use heic2any https://github.com/alexcorvi/heic2any to convert in the fly, seems straightforward.

The thumbnails may be a harder problem, sharp needs packages installed in the computer https://github.com/lovell/sharp/issues/2004 in order to work with HEIC, so maybe for a first version not show: SCR-20240204-jutm.png (view on web) https://github.com/OneFolderApp/OneFolder/assets/27826950/ca62c622-8fe6-43e0-b114-072c1036831a — Reply to this email directly, view it on GitHub https://github.com/OneFolderApp/OneFolder/issues/72#issuecomment-1925666268, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJ3XC4XSAV3RA7JCAH4FRDYR5KLTAVCNFSM6AAAAABCYJ674SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVGY3DMMRWHA. You are receiving this because you were mentioned.

AShortcuts commented 6 months ago

This article by another photo management app might be helpful for integrating heic support

https://photostructure.com/getting-started/heif-support/