bpatrik / pigallery2

A fast directory-first photo gallery website, with rich UI, optimized for running on low resource servers (especially on raspberry pi)
http://bpatrik.github.io/pigallery2/
MIT License
1.75k stars 203 forks source link

Request: (Apple) HEIC images #97

Open iAmRenzo opened 5 years ago

iAmRenzo commented 5 years ago

Support of heic images from iPhone

bpatrik commented 5 years ago

Hi

unfortunately non of the browsers are supporting that file format: https://caniuse.com/#feat=heif So I cannot just add it now.

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

bpatrik commented 4 years ago

Hi,

unfortunately its not easy to add ass HEIC not an open format. Read more here: https://github.com/lovell/sharp/issues/1105

So I cannot add this in the near future.

Best, Patrik

helmut72 commented 3 years ago

lovell/sharp#1105 is closed

bpatrik commented 3 years ago

A gave it a quick look (with sharp v0.27.0 and I still get heif: Unsupported feature: Unsupported codec (4.3000) (Tested on https://github.com/tigranbs/test-heic-images/blob/master/image1.heic).

Without looking in to it in depth, this: https://github.com/lovell/sharp/issues/1105#issuecomment-631143395 suggests that works only on mac?

presto8 commented 2 years ago

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!

presto8 commented 2 years ago

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?

bpatrik commented 2 years ago

There is an open issue about upgrading sharp to the latest version: https://github.com/bpatrik/pigallery2/issues/295

Unfortunately it is not trivial, as I would like to keep supporting arm based Docker images

yllekz commented 2 years ago

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.

https://github.com/photoview/photoview/pull/271

bpatrik commented 2 years ago

There was a sharp update recently, so this request might be unblocked. Someone need to check it.

HuwSy commented 2 years ago

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.

bpatrik commented 2 years ago

try adding it here and see what happens: https://github.com/bpatrik/pigallery2/blob/1e8830ab09686da171b2a0a49fec5eac79943646/src/common/SupportedFormats.ts#L2

samoxentral commented 2 years ago

any update for that?

relink2013 commented 2 years ago

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.

bpatrik commented 1 year ago

Taking an additional look. sharp (the library used for image conversions) does not support heic out of the box: https://github.com/lovell/sharp/issues/2004#issuecomment-564104958 -> https://github.com/lovell/sharp/issues/1105#issuecomment-516010573

To my understanding Dockerfile should be updated and we need to manually install libheif then libvips then sharp through npm: https://github.com/lovell/sharp/issues/2004#issuecomment-565748090

Here are some Docker file samples that would be a good starting point: https://github.com/libvips/libvips/issues/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.

martadinata666 commented 1 year ago

Looking on https://packages.debian.org/sid/libvips-dev it build with HEIF support, so rather than using lovell version libvips, using distro libvips seems viable πŸ€”

Edit: confirmed that using distro libvips will support heic, in my test using debian sid. Image taken from here https://github.com/tigranbs/test-heic-images Pigallery2 log about heic render

pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:37:59 AM[VERBS] GET /api/gallery/content/test-heic-images/README.md 200 1ms
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:37:59 AM[SILLY] [SharpRenderer] rendering photo:/images/test-heic-images/image2.heic, size:240
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:37:59 AM[SILLY] [SharpRenderer] rendering photo:/images/test-heic-images/image3.heic, size:240
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:37:59 AM[SILLY] [SharpRenderer] rendering photo:/images/test-heic-images/image4.heic, size:240
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:37:59 AM[SILLY] [SharpRenderer] rendering photo:/images/test-heic-images/image5.png, size:480
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:38:01 AM[VERBS] GET /api/gallery/content/test-heic-images/image4.heic/thumbnail/240 200 1811ms
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:38:01 AM[VERBS] GET /api/gallery/content/test-heic-images/image2.heic/thumbnail/240 200 2141ms
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:38:02 AM[VERBS] GET /api/gallery/content/test-heic-images/image5.png/thumbnail/480 200 2510ms
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:38:02 AM[VERBS] GET /api/gallery/content/test-heic-images/image3.heic/thumbnail/240 200 2603ms
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:41:08 AM[SILLY] [SharpRenderer] rendering photo:/images/test-heic-images/image1.heic, size:1080
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:41:11 AM[VERBS] GET /api/gallery/content/test-heic-images/image1.heic/bestFit 200 2311ms
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:41:11 AM[SILLY] [SharpRenderer] rendering photo:/images/test-heic-images/image2.heic, size:1080
pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:41:13 AM[VERBS] GET /api/gallery/content/test-heic-images/image2.heic/bestFit 200 2051ms

Metadata err?

pigallery2d_app.1.z5i4wzsmg1cy@homelab    | 11/24/2022, 11:37:59 AM[DEBUG][MetadataLoader] Error parsing exif /images/test-heic-images/image4.heic TypeError: unsupported file type: undefined (file: /images/test-heic-images/image4.heic)
pigallery2d_app.1.z5i4wzsmg1cy@homelab    |     at lookup (/home/debian/pigallery2/node_modules/image-size/dist/index.js:51:11)
pigallery2d_app.1.z5i4wzsmg1cy@homelab    |     at imageSize (/home/debian/pigallery2/node_modules/image-size/dist/index.js:124:16)
pigallery2d_app.1.z5i4wzsmg1cy@homelab    |     at /home/debian/pigallery2/src/backend/model/threading/MetadataLoader.js:179:69
pigallery2d_app.1.z5i4wzsmg1cy@homelab    |     at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5)

2022-11-24-114322_1908x521_scrot

bpatrik commented 1 year ago

Moved the 'supportedformats' to the config, so people can easier experiment with supported extensions

bpatrik commented 1 year ago

Similarly to #567 and #36.

HEI* is not supported by mainstream browsers (only by safari)

kΓ©p

Until that is changes, the app wont support this format either.

yllekz commented 1 year ago

I don't understand that chart stating Firefox doesn't support it? I can view HEIC files in Firefox just fine via other means.

bpatrik commented 1 year ago

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. RAW and TIFF photos have the same issue #127. Browser cannot render them.

elpendor commented 1 year ago

Any news on this?

Or at least some tips on how to implement it?

DrPeterVC commented 1 year ago

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 :-)

bpatrik commented 1 year ago

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 https://github.com/bpatrik/pigallery2/issues/97#issuecomment-1399302046, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKA5VYHU3VOWACQL3WL5DWTQQSRANCNFSM4ILS3SMQ . You are receiving this because you commented.Message ID: @.***>

DrPeterVC commented 1 year ago

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.

bpatrik commented 1 year ago

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 https://github.com/bpatrik/pigallery2/issues/97#issuecomment-1400214511, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKA5TNSS5SU4J7FK24XE3WTZVV7ANCNFSM4ILS3SMQ . You are receiving this because you commented.Message ID: @.***>

v-marinkov commented 1 year ago

I love the ability of Pigallery to read index.md files per folder. I'd been looking for a piece of software that replicates Google Photo's blog-type paragraphs. Unfortunately, the lack of HEIC support is the only dealbreaker for me.

DrPeterVC commented 1 year ago

I think browsers will eventually have to include HEIC and this will happen automatically in time. But in the meantime I get round it by adding heif-convert to run on newly downloaded files (watch for the orientation flag though). My intention is that all the generated JPGs can be removed once native support appears! This is still my favourite photo gallery tool, by far, for showing photos to friends and family. I am in the process of making it available through SWAG and possibly changing the config to User by default and having authelia as a more robust login process. The inability to change passwords through the GUI is a minor irritation.

moneytoo commented 1 year ago

I think browsers will eventually have to include HEIC and this will happen automatically in time.

I wouldn't be so optimistic: https://bugs.chromium.org/p/chromium/issues/detail?id=843310

Support .HEIC: WontFix (Closed)

No plans. Safari doesn't even support HEIC AFAIK: https://caniuse.com/?search=heic - We'd need a software decoder to add support in Chrome, so it's pretty unlikely that we'd add support for HEIC.

v-marinkov commented 1 year ago

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.

Are there any quality sacrifices doing this? Do you still keep the original .heic files along the .jpg?

Are there any plans for doing this conversion automatically like PhotoView does it with libehif?

DrPeterVC commented 1 year ago

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).

v-marinkov commented 1 year ago

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?

ReessKennedy commented 7 months ago

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.

ReessKennedy commented 7 months ago

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
bpatrik commented 7 months ago

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 https://github.com/bpatrik/pigallery2/issues/97#issuecomment-1940420711, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKA5SZUSVSV3WEADWERIDYTLWKFAVCNFSM4ILS3SM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUGA2DEMBXGEYQ . You are receiving this because you were mentioned.Message ID: @.***>

ReessKennedy commented 7 months ago

AMAZING! ... Sorry I didn't catch this. I will try it. Amazing work, again.

martadinata666 commented 7 months ago

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".

#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:18-alpine3.17 AS builder
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.17/community/ \
  python3 build-base sqlite-dev sqlite-libs vips-dev vips-heif fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python
COPY pigallery2-release /app
WORKDIR /app
RUN npm install --unsafe-perm
RUN mkdir -p /app/data/config && \
    mkdir -p /app/data/db && \
    mkdir -p /app/data/images && \
    mkdir -p /app/data/tmp

#-----------------MAIN--------------------
#-----------------------------------------
FROM node:18-alpine3.17 AS main
WORKDIR /app
ENV NODE_ENV=production \
    # overrides only the default value of the settings (the actualy value can be overwritten through config.json)
    default-Database-dbFolder=/app/data/db \
    default-Media-folder=/app/data/images \
    default-Media-tempFolder=/app/data/tmp \
    default-Extensions-folder=/app/data/config/extensions \
    # flagging dockerized environemnt
    PI_DOCKER=true

EXPOSE 80
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.17/community/ \
    vips vips-cpp ffmpeg vips-heif
COPY --from=builder /app /app
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]

# Run build time diagnostics to make sure the app would work after build is finished
RUN ["node", "./src/backend/index", "--expose-gc",  "--run-diagnostics", "--config-path=/app/diagnostics-config.json"]
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
  CMD wget --quiet --tries=1 --no-check-certificate --spider \
  http://localhost:80/heartbeat || exit 1

# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc",  "--config-path=/app/data/config/config.json"]

But even pigallery2 can read and generate thumb for heic/heif, metadata loader error still occurred.

pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:11 AM[DEBUG][MetadataLoader] Error parsing exif /app/data/images/heic/image3.heic TypeError: unsupported file type: undefined (file: /app/data/images/heic/image3.heic)
pigallery2-test-pigallery2-1  |     at lookup (/app/node_modules/image-size/dist/index.js:42:11)
pigallery2-test-pigallery2-1  |     at imageSize (/app/node_modules/image-size/dist/index.js:113:16)
pigallery2-test-pigallery2-1  |     at /app/src/backend/model/threading/MetadataLoader.js:213:73
pigallery2-test-pigallery2-1  |     at FSReqCallback.wrapper [as oncomplete] (node:fs:677:5)
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:11 AM[DEBUG][MetadataLoader] Error parsing exif /app/data/images/heic/image4.heic TypeError: unsupported file type: undefined (file: /app/data/images/heic/image4.heic)
pigallery2-test-pigallery2-1  |     at lookup (/app/node_modules/image-size/dist/index.js:42:11)
pigallery2-test-pigallery2-1  |     at imageSize (/app/node_modules/image-size/dist/index.js:113:16)
pigallery2-test-pigallery2-1  |     at /app/src/backend/model/threading/MetadataLoader.js:213:73
pigallery2-test-pigallery2-1  |     at FSReqCallback.wrapper [as oncomplete] (node:fs:677:5)
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:11 AM[VERBS] GET /pgapi/gallery/content/heic 200 352ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:11 AM[VERBS] GET /pgapi/share/list/heic 200 3ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:11 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/heic/image2.heic, size:240
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:11 AM[VERBS] GET /pgapi/gallery/content/heif/IMG_5439-1.heif/thumbnail/240 200 1927ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:12 AM[VERBS] GET /pgapi/gallery/content/heic/image2.heic/thumbnail/240 200 1013ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:12 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/heic/image3.heic, size:240
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:13 AM[VERBS] GET /pgapi/gallery/content/heic/image3.heic/thumbnail/240 200 967ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:13 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/heic/image4.heic, size:240
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:15 AM[VERBS] GET /pgapi/gallery/content/heic/image4.heic/thumbnail/240 200 1716ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:15 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/heic/image5.png, size:480
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:15 AM[DEBUG] GET /heartbeat 200 13ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:17 AM[VERBS] GET /pgapi/gallery/content/heic/image5.png/thumbnail/480 200 2194ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:19 AM[VERBS] GET /pgapi/share/list/ 200 3ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:19 AM[VERBS] GET /pgapi/gallery/content/%2F?klm=1708395165562&kls=1708397848584 200 2ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:58:55 AM[DEBUG] GET /heartbeat 200 8ms
pigallery2-test-pigallery2-1  | 2/20/2024, 2:59:35 AM[DEBUG] GET /heartbeat 200 1ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:00:15 AM[DEBUG] GET /heartbeat 200 1ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:00:55 AM[DEBUG] GET /heartbeat 200 1ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:01:35 AM[DEBUG] GET /heartbeat 200 5ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:15 AM[DEBUG] GET /heartbeat 200 1ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:16 AM[VERBS] GET /pgapi/share/list/ 200 3ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:19 AM[VERBS] GET /pgapi/gallery/content/heic 200 14ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:19 AM[VERBS] GET /pgapi/share/list/heic 200 3ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:19 AM[VERBS] GET /pgapi/share/list/heic 200 2ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:21 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/heic/image3.heic, size:1080
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:22 AM[VERBS] GET /pgapi/gallery/content/heic/image3.heic/bestFit 200 1596ms
pigallery2-test-pigallery2-1  | 2/20/2024, 3:02:22 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/heic/image4.heic, size:1080
ReessKennedy commented 7 months ago

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 image: bpatrik/pigallery2:edge-alpine

I had initially just been using image: bpatrik/pigallery2:latest in my docker compose.

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.

bpatrik commented 6 months ago

@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 heic support to the code itself: https://github.com/bpatrik/pigallery2/blob/4352ff89b76bda8c803c670c158fd51749f568dc/src/common/config/public/ClientConfig.ts#L1257

martadinata666 commented 6 months ago

Current state, in simple terms and in term of thumbnail generation :edge-alpine πŸ‘πŸΌ :edge-buster πŸ‘ŽπŸΌ (reads but does not generate thumbnail properly) :edge-bullseye πŸ‘ŽπŸΌ (reads but does not generate thumbnail properly) :bookworm πŸ‘πŸΌ (not exist yet, but tested locally)

PaddyPat commented 6 months ago

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

martadinata666 commented 6 months ago

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

pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[VERBS] GET /pgapi/gallery/content/HEIC 200 180ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[VERBS] GET /pgapi/share/list/HEIC 304 5ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[VERBS] GET /pgapi/gallery/content/HEIC/README.md 304 6ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIC/image2.heic, size:320
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIC/image3.heic, size:320
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIC/image4.heic, size:320
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:15 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIC/image5.png, size:540
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:18 AM[VERBS] GET /pgapi/gallery/content/HEIC/image2.heic/320 200 3040ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:18 AM[VERBS] GET /pgapi/gallery/content/HEIC/image3.heic/320 200 3170ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:19 AM[VERBS] GET /pgapi/gallery/content/HEIC/image4.heic/320 200 4174ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:19 AM[VERBS] GET /pgapi/gallery/content/HEIC/image5.png/540 200 4328ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:22 AM[VERBS] GET /pgapi/gallery/content/ 200 35ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:22 AM[VERBS] GET /pgapi/share/list/ 304 6ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:22 AM[SILLY] [SharpRenderer] rendering photo:/ap
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:26 AM[VERBS] GET /pgapi/gallery/content/HEIF 200 244ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:26 AM[VERBS] GET /pgapi/share/list/HEIF 304 5ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:26 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIF/IMG_5438-1.heif, size:320
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:26 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIF/IMG_5436-1.heif, size:540
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:26 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIF/IMG_5439-1.heif, size:320
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:30 AM[VERBS] GET /pgapi/gallery/content/HEIF/IMG_5438-1.heif/320 200 4416ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:30 AM[VERBS] GET /pgapi/gallery/content/HEIF/IMG_5439-1.heif/320 200 4602ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:30 AM[VERBS] GET /pgapi/gallery/content/HEIF/IMG_5436-1.heif/540 200 4680ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:36 AM[DEBUG] GET /heartbeat 200 15ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:39 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/HEIF/IMG_5439-1.heif, size:2160
pigallery2-test-pigallery2-1  | 3/8/2024, 7:20:43 AM[VERBS] GET /pgapi/gallery/content/HEIF/IMG_5439-1.heif/2160 200 4619ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:21:16 AM[DEBUG] GET /heartbeat 200 4ms
pigallery2-test-pigallery2-1  | 3/8/2024, 7:21:30 AM[SILLY] [SharpRenderer] rendering photo:/app/data/images/RAW/field.ARW, size:320
pigallery2-test-pigallery2-1  | 3/8/2024, 7:21:30 AM[WARN_] Handled error:
pigallery2-test-pigallery2-1  | ErrorDTO {
pigallery2-test-pigallery2-1  |   code: 32,
pigallery2-test-pigallery2-1  |   message: 'Error during generating thumbnail: /app/data/images/RAW/field.ARW',
pigallery2-test-pigallery2-1  |   details: 'Error: Input file contains unsupported image format',
pigallery2-test-pigallery2-1  |   request: { method: '', url: '' }
pigallery2-test-pigallery2-1  | }
bpatrik commented 6 months ago

@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.

PaddyPat commented 6 months ago

... removed old database ... and tried it again,.. it looks now fine with edge-alpine

bpatrik commented 6 months ago

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 https://github.com/bpatrik/pigallery2/issues/97#issuecomment-1985562068, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZKA5SVRDQSJX57I7VB4W3YXGRB5AVCNFSM4ILS3SM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJYGU2TMMRQGY4A . You are receiving this because you were mentioned.Message ID: @.***>

benhedrington commented 5 months ago

@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?

bpatrik commented 5 months ago

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

benhedrington commented 5 months ago

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.

rhatguy commented 4 months ago

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?

bpatrik commented 4 months ago

Info on the picture is reporting that its a 512x512 pixel picture

The issues is with the Metadataloader reading the wrong dimension. There was a significant refactor there recently. I guess heic was not properly tested.

rubpa commented 3 months ago

Please reset your DB that will fix it.

Hi! Trying out pigallery2 for the first time and I've HEIC images. I already ran once with bpatrik/pigallery2:latest. Now I modified docker-compose.yml and replaced the image with bpatrik/pigallery2:edge-alpine. However, the heic files don't show up. I guess I need to reset the db. Kindly advise on how to reset the db or any other changes.

rhatguy commented 3 months ago

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.