-
Notifications
You must be signed in to change notification settings - Fork 194
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
Request: (Apple) HEIC images #97
Comments
Hi unfortunately non of the browsers are supporting that file format: In the future I'll implement a . to *.jpg converter in the app, with that feature I can support heic too. (sorry deadline promises, probably will take months) Patrik |
Hi, unfortunately its not easy to add ass HEIC not an open format. Read more here: lovell/sharp#1105 So I cannot add this in the near future. Best, |
lovell/sharp#1105 is closed |
A gave it a quick look (with sharp v0.27.0 and I still get Without looking in to it in depth, this: lovell/sharp#1105 (comment) suggests that works only on mac? |
I am not that familiar with Node development, but would it be possible to use something like heif-convert (external command-line tool, does not require a Mac). If heif-convert could be used to transcode HEIF to JPG and then store the JPG files in the cache/thumbnails directory, it would be a huge benefit for those of us who have huge HEIF libraries. Thank you! |
More info on this: libvips supports HEIF now (tested on Linux, version 8.12.1). Since sharp uses libvips, I think this feature may work if the sharp dependency is updated to the latest version? |
There is an open issue about upgrading sharp to the latest version: #295 Unfortunately it is not trivial, as I would like to keep supporting arm based Docker images |
If it helps, "viktorstrate/PhotoView" is capable of reading the HEIC format and it runs on Pis/M1/etc. Might be able to have a look at his implementation. |
There was a sharp update recently, so this request might be unblocked. Someone need to check it. |
Could a basic heic without encoding be added, so it still indexes the exif info, still puts them on page but without thumbnailing then if the browser supports them they are displayed and if not an onerror handler returns the blank loading image. It would at least work for some cases until something better can be done. |
try adding it here and see what happens:
|
any update for that? |
Im curious about this as I would really like to give pigallery a try but nearly all of the photos I have taken in the last several years are HEIC many of them live photos with an additional .mov file. |
Taking an additional look. sharp (the library used for image conversions) does not support heic out of the box: lovell/sharp#2004 (comment) -> lovell/sharp#1105 (comment) To my understanding Dockerfile should be updated and we need to manually install Here are some Docker file samples that would be a good starting point: libvips/libvips#1844 I do not own any apple product, so I'm less motivated investing in HEIC support, but happy to give guidance if anyone else would like to do change. |
Looking on Edit: confirmed that using distro
Metadata err?
|
Moved the 'supportedformats' to the config, so people can easier experiment with supported extensions |
I don't understand that chart stating Firefox doesn't support it? I can view HEIC files in Firefox just fine via other means. |
I mean if you try to open a supported file (like jpg) with firefox or chrome then they will show that photo. If you try to do the same with HEIC, the browser will only offer to download that file as they cannot render them. Only safari support HEIC natively. So the app would need to convert HEIC (sharp support needed) to some browser supported format (jpg,webp) and only show that one. |
Any news on this? Or at least some tips on how to implement it? |
I suspect that HEIC will gradually replace JPG as it is a superior compression format. About a year ago my Samsung Android (A41) started to produce heic format photos (without any promoting from me - probably a system update) rather than jpg. So though Plex and FileManager + seem to be fine with displaying them it would be great it Pigallery2 could handle them too - as my gallery is now stuck in the past :-) |
At the moment pigallery2 can only support those image formats that the
browsers also support natively. So you need to convince chrome and Firefox
first to implement it :)
…-- Sorry for being brief, sent from my phone.
On Sun, 22 Jan 2023, 01:06 DrPeterVC, ***@***.***> wrote:
I suspect that HEIC will gradually replace JPG as it is a superior
compression format. About a year ago my Samsung Android (A41) started to
produce heic format photos (without any promoting from me - probably a
system update) rather than jpg. So though Plex and FileManager + seem to be
fine with displaying them it would be great it Pigallery2 could handle them
too - as my gallery is now stuck in the past :-)
—
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5VYHU3VOWACQL3WL5DWTQQSRANCNFSM4ILS3SMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Many thanks for your rapid response. I am actually mega impressed with the program. Though I use Plex it's handling of photos is limited. What I like about pigallery2 is it's sheer speed on pi (I have failed to get Jellyfin to work satisfactorily) and it's ability to recognise face tags (I have methodically tagged faces using various apps over the years). I have got a very simple workaround for the heic issue - I just ran heif-convert on the directory with the photos and now all I need to do is correct the orientation with some using exiftool. I feel sure heic will be supported by all browsers in time. Many thanks again. |
I'm happy that you like the app.
In the long run I plan to support images that browser do not support
natively (like raw photos). But I don't see that happening in the next 2-3
years.
Correcting the orientation steps seems odd to me. The app should be able to
handle it.
…-- Sorry for being brief, sent from my phone.
On Mon, 23 Jan 2023, 18:47 DrPeterVC, ***@***.***> wrote:
Many thanks for your rapid response. I am actually mega impressed with the
program. Though I use Plex it's handling of photos is limited. What I like
about pigallery2 is it's sheer speed on pi (I have failed to get Jellyfin
to work satisfactorily) and it's ability to recognise face tags (I have
methodically tagged faces using various apps over the years).
I have got a very simple workaround for the heic issue - I just ran
heif-convert on the directory with the photos and now all I need to do is
correct the orientation with some using exiftool.
I feel sure heic will be supported by all browsers in time.
Many thanks again.
—
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5TNSS5SU4J7FK24XE3WTZVV7ANCNFSM4ILS3SMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
AFIK There is no loss of quality. I have just looked at the converted JPGs and they are significantly bigger (more than twice the size). Don't worry the original files are left untouched. I have not yet worked out if tags (and face tags) are handled - I suspect not as an XMP file (sidecar) is also generated. My current project is to replace the login (which is a bit basic) with authelia so I am not currently looking at how tags are handled. I have no idea why this gallery viewer has so little traction as it is far superior to any of the other ones out there (at least for a low powered server like a Pi). |
I just set up Nextcloud to auto-upload images to my root Pigallery folder and I noticed that it automatically converts HEIC to JPG on iPhones, which is great for me! @DrPeterVC how are you uploading your iPhone photos to your server? |
PROPOSAL: Since Pigallery2 creates thumbs for everything you see in a web browser (in Webm format) then why cant it just generate the Webm files from heic ... Seems there are many libraries that do this: https://github.com/alexcorvi/heic2any Then if people want to download originals they can download the HEIC files othrwise they are just looking at the web-compatible thumbnails! Pros:
Amazing work on this @bpatrik! Thanks for all you do. I get perhaps you use Android so maybe this isn't a personal use case improvement but would be a major win for iPhone users. At first I was annoyed with Apple for creating this new file format but when I realized it's 60% smaller file size and superior in quality I was sold! ... Realizing that almost every photo gallery app generates thumbnails I decided that flexible thumbnail generation seems like the best way to get around this issue. |
Hi
There is already a thread around this question somewhere. Basically the
conclusion here is that lib(sharp) that app uses to generate thumbnails
support heic, but libvips(the underlying lib) should be manually built in
the docker file with the support of heic.
Same for DNG raw photos (an other separate thread for that)
…-- Sorry for being brief, sent from my phone.
On Tue, 13 Feb 2024, 05:50 Reess Kennedy, ***@***.***> wrote:
As additional FYI, PhotoView and PhotoPrism do something like this but
they both create larg-ish Jpegs thumbs and I am thinking Pigallery is fine
with just create very small Webp thumbs to keep things minimal! ... As an
example, this is the Photoview sidebar showing that it basically create a
similarly-sized Jpeg of the HEIC file I uploaded.
Photo.view.sizing.png (view on web)
<https://github.com/bpatrik/pigallery2/assets/3970267/6cc92646-4803-4eb4-9c87-ab6c9dfe60b7>
—
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5SZUSVSV3WEADWERIDYTLWKFAVCNFSM4ILS3SM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUGA2DEMBXGEYQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
AMAZING! ... Sorry I didn't catch this. I will try it. Amazing work, again. |
Long story short about the "alpine" image build that still does not correctly read HEIF/HEIC. The alpine "vips-dev" package doesn't bother to install "vips-heif" so the sharp module still can't read heif/heic correctly when on Debian based "libvips-dev" that I experienced, will also pull "libheif". So yeah, we just need add "vips-heif" to "Dockerfile.alpine".
But even pigallery2 can read and generate thumb for heic/heif, metadata loader error still occurred.
|
I got it to work following the instructions from @martadinata666 and rebuilding Pigallery2 using the edge-alpine image ... https://hub.docker.com/layers/bpatrik/pigallery2/edge-alpine/images/sha256-e36eee2f3d9ee026ff6394dfc4d69989bebc42d6ecc4c7062407c9a722a3649e?context=explore So using I had initially just been using Once I rebuilt using this I just went into config and added heic and heif to the list of supported files and then reran a bunch of the jobs and refreshed and BOOM! Success. Hopefully this helps others who wish to not have to convert all their iphone or heic photos in advance. Now I'm looking forward to really have fun with Pigallery. |
@martadinata666 Do you know if this works for all 3 platforms (alpine and the 2 debian) now? (lost track with the PRs) If yes, we should add
|
Current state, in simple terms and in term of thumbnail generation |
The latest update 7hrs ago for bpatrik/pigallery2:edge-alpine doesn’t work. How could we use the previous version of bpatrik/pigallery2:edge-alpine @bpatrik it shows in gallery view only the moving square |
If the square moving/animating it should be generating thumbnails. I had some personal HEIF images, it works. On heic taken from https://github.com/tigranbs/test-heic-images it also works. Any log given? My logs sample as pigallery rendering
|
@PaddyPat can you try a DB reset? If it doesn't solve it, can provide debug logs from the server, and from the browser maybe also some screenshots to see where it stops. |
... removed old database ... and tried it again,.. it looks now fine with edge-alpine |
Please reset your DB that will fix it.
…-- Sorry for being brief, sent from my phone.
On Fri, 8 Mar 2024, 12:53 PaddyPat, ***@***.***> wrote:
running pigallery2 with mariadb.
when I add new heic images, I see the black quare and in logfiles:
pigallery2-db | 2024-03-08 12:50:14 0 [Note] /usr/bin/mysqld: ready for
connections.
pigallery2-db | Version: '10.5.11-MariaDB-log' socket:
'/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
pigallery2 | 3/8/2024, 11:50:15 AM[INFO_][server] running diagnostics...
pigallery2 | 3/8/2024, 11:50:16 AM[INFO_][JobManager] Running job schedules
pigallery2 | 3/8/2024, 11:50:16 AM[INFO_][server] Listening on port 80
pigallery2 | 3/8/2024, 11:50:25 AM[WARN_] Handled error:
pigallery2 | ErrorDTO {
pigallery2 | code: 31,
pigallery2 | message: 'Error during listing the directory',
pigallery2 | details: QueryFailedError: ER_BAD_FIELD_ERROR: Unknown column
'media.metadataCreationdateoffset' in 'field list'
pigallery2 | at Query.
(/app/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:158:37)
pigallery2 | at Query. (/app/node_modules/mysql/lib/Connection.js:526:10)
pigallery2 | at Query._callback
(/app/node_modules/mysql/lib/Connection.js:488:16)
pigallery2 | at Sequence.end
(/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
pigallery2 | at Query.ErrorPacket
(/app/node_modules/mysql/lib/protocol/sequences/Query.js:92:8)
pigallery2 | at Protocol._parsePacket
(/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
pigallery2 | at Parser._parsePacket
(/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
pigallery2 | at Parser.write
(/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
pigallery2 | at Protocol.write
(/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
pigallery2 | at Socket. (/app/node_modules/mysql/lib/Connection.js:88:28)
pigallery2 | at Socket. (/app/node_modules/mysql/lib/Connection.js:526:10)
pigallery2 | at Socket.emit (node:events:517:28)
pigallery2 | at addChunk (node:internal/streams/readable:368:12)
pigallery2 | at readableAddChunk (node:internal/streams/readable:341:9)
pigallery2 | at Readable.push (node:internal/streams/readable:278:10)
pigallery2 | at TCP.onStreamRead
(node:internal/stream_base_commons:190:23) {
pigallery2 | query: 'SELECT directory.id AS directory_id, directory.name
AS directory_name, directory.path AS directory_path, directory.
lastModified AS directory_lastModified, directory.lastScanned AS
directory_lastScanned, directory.mediaCount AS directory_mediaCount,
directory.oldestMedia AS directory_oldestMedia, directory.youngestMedia
AS directory_youngestMedia, directory.validCover
—
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5SVRDQSJX57I7VB4W3YXGRB5AVCNFSM4ILS3SM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJYGU2TMMRQGY4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@bpatrik I am using edge-alpine and working well for HEIC. What will be the event or timing that transitions this functionality to latest-alpine or other such more standard image? |
I have no timeline yet. I would like to get the extensions to a relatively stable state for the next release,but I got quite busy with life recently. To give some ETA: if it won't happen in May then maybe only in September |
I can appreciate that and have lived through those times. Appreciate the rough ETA. |
I switched over to edge alpine last night, added heic to the supported types, and its working with images shot on my Oneplus 12. The thumbnails appear to be square, so they look stretched. Info on the picture is reporting that its a 512x512 pixel picture, which I assume has something to do with the stretched thumbnails. Is that expected at this point? |
The issues is with the Metadataloader reading the wrong dimension. There was a significant refactor there recently. I guess heic was not properly tested. |
Hi! Trying out pigallery2 for the first time and I've HEIC images. I already ran once with |
There is a button in the settings for PiGallery2 called "Run now: Gallery reset". This will effectively cause PiGallery2 to reindex everything on the next index run. Separately, you could also just delete the db itself from wherever you have docker storing it. There should be no data in the DB that can't be re-created by re-indexing. |
Thank rhatguy! Here's what worked. I could not find supported formats in the Settings UI. Hence modified Using Firefox on Windows, the heic photos do show up even when clicked. I understand that the webp format is loaded in this view. Only when I zoom in (double click), the heic seems to be transferred and it doesn't show the photo. However, pinch zoom photo does show on Safari on the iPhone I have. |
I guess FF doe snot support heic. When you zoom the original is loaded, otherwise webp. |
How does one "reset the database" ? I tried stopping the container, removing the "db" folder, and restarting the container, however that reset the setting in which I added the heic/heif files under supported file formats. |
Support of heic images from iPhone
The text was updated successfully, but these errors were encountered: