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

Request: (Apple) HEIC images #97

Open
iAmRenzo opened this issue Aug 14, 2019 · 53 comments
Open

Request: (Apple) HEIC images #97

iAmRenzo opened this issue Aug 14, 2019 · 53 comments

Comments

@iAmRenzo
Copy link

Support of heic images from iPhone

@bpatrik
Copy link
Owner

bpatrik commented Aug 18, 2019

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 bpatrik added this to the v1.8 milestone Aug 18, 2019
@bpatrik
Copy link
Owner

bpatrik commented Dec 12, 2019

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,
Patrik

@bpatrik bpatrik removed this from the v1.8 milestone Dec 12, 2019
@helmut72
Copy link

lovell/sharp#1105 is closed

@bpatrik
Copy link
Owner

bpatrik commented Dec 28, 2020

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: lovell/sharp#1105 (comment) suggests that works only on mac?

@presto8
Copy link

presto8 commented Dec 21, 2021

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
Copy link

presto8 commented Jan 21, 2022

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
Copy link
Owner

bpatrik commented Feb 6, 2022

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

@yllekz
Copy link

yllekz commented May 11, 2022

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.

photoview/photoview#271

@bpatrik
Copy link
Owner

bpatrik commented May 14, 2022

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

@HuwSy
Copy link

HuwSy commented Jun 22, 2022

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
Copy link
Owner

bpatrik commented Aug 20, 2022

try adding it here and see what happens:

Photos: ['gif', 'jpeg', 'jpg', 'jpe', 'png', 'webp', 'svg'],

@samoxentral
Copy link

any update for that?

@relink2013
Copy link

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
Copy link
Owner

bpatrik commented Nov 23, 2022

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 libheif then libvips then sharp through npm: lovell/sharp#2004 (comment)

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.

@martadinata666
Copy link
Contributor

martadinata666 commented Nov 24, 2022

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
Copy link
Owner

bpatrik commented Nov 25, 2022

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

@bpatrik
Copy link
Owner

bpatrik commented Jan 4, 2023

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
Copy link

yllekz commented Jan 5, 2023

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
Copy link
Owner

bpatrik commented Jan 5, 2023

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
Copy link

Any news on this?

Or at least some tips on how to implement it?

@DrPeterVC
Copy link

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
Copy link
Owner

bpatrik commented Jan 21, 2023 via email

@DrPeterVC
Copy link

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
Copy link
Owner

bpatrik commented Jan 23, 2023 via email

@DrPeterVC
Copy link

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
Copy link

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
Copy link

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:

  • Your actual library can stay small and use the latest tech
  • You needn't run through hoops to pre-convert to JPEG just to make it work for PiGallery

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
Copy link

ReessKennedy commented Feb 13, 2024

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
Copy link
Owner

bpatrik commented Feb 13, 2024 via email

@ReessKennedy
Copy link

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

@martadinata666
Copy link
Contributor

martadinata666 commented Feb 20, 2024

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

bpatrik added a commit that referenced this issue Feb 20, 2024
@ReessKennedy
Copy link

ReessKennedy commented Feb 21, 2024

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 added a commit that referenced this issue Feb 21, 2024
Add heif support via VIPS (debian docker image) #609 #561 #97
@bpatrik
Copy link
Owner

bpatrik commented Mar 3, 2024

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

supportedFormats: string[] = ['gif', 'jpeg', 'jpg', 'jpe', 'png', 'webp', 'svg'];

@martadinata666
Copy link
Contributor

martadinata666 commented Mar 4, 2024

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
Copy link

PaddyPat commented Mar 8, 2024

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
Copy link
Contributor

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
Copy link
Owner

bpatrik commented Mar 8, 2024

@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
Copy link

PaddyPat commented Mar 8, 2024

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

@bpatrik
Copy link
Owner

bpatrik commented Mar 8, 2024 via email

@benhedrington
Copy link

@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
Copy link
Owner

bpatrik commented Apr 4, 2024

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
Copy link

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
Copy link

rhatguy commented May 21, 2024

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
Copy link
Owner

bpatrik commented May 21, 2024

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
Copy link

rubpa commented Jun 20, 2024

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
Copy link

rhatguy commented Jun 21, 2024

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.

@rubpa
Copy link

rubpa commented Jun 23, 2024

Thank rhatguy! Here's what worked. I could not find supported formats in the Settings UI. Hence modified config.json, Photo -> supportedFormats and added heic there. Then in Settings -> Indexing -> Run now: Gallery reset. The heic photos started showing up. As you have pointed out earlier, the thumbnails are square but the photos load correctly.

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.

@bpatrik
Copy link
Owner

bpatrik commented Jun 28, 2024

I guess FF doe snot support heic. When you zoom the original is loaded, otherwise webp.
Photos are square because there is an issue in the metadaloader to determine its exact dimension, so a default 1x1 is used (you can double check that in the info sidebar when you preview the photo.

@yllekz
Copy link

yllekz commented Jul 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests