immich icon indicating copy to clipboard operation
immich copied to clipboard

feat (web/server) 360 degrees Web panoramas

Open dmitry-brazhenko opened this issue 1 year ago • 12 comments

In this PR I aded

  1. Support for 360 Panoramas as it was discussed here: https://github.com/immich-app/immich/discussions/1630
  2. Minor technical changes and improvements

How it was implemented

  1. Once an images is uploaded, in metadata-extraction.processor.ts it checks aspectRatio. If it is aspectRatio >= 2, we assume that it is a panorama. This can be potentialy improved, but looks like a common way to determine if image is a panorama or not
  2. If it is a panorama, we add a prtoperty isPanorama: true
  3. We use library @egjs/svelte-view360 to show the panoram
  4. In the library we use a special symbol to display if a thumb is a panorama.

Minor technical changes and improvements:

  1. restart:always for all docker containers in development docker-compose
  2. Fixed links in database-migrations.md file

Potential further improvements:

  1. Probably we can switch library and use smth else. But this liibrary works OK both on desktop and mobile-web
  2. Support panoramas in Flutter mobile app
  3. There 360 videos. Later we can support them as well

Here is thumb that shows a panorama: 2023-07-03_17-48-25

Panorama after is opened: 2023-07-03_17-50-11

dmitry-brazhenko avatar Jul 03 '23 10:07 dmitry-brazhenko

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Visit Preview Jul 23, 2023 5:54pm

vercel[bot] avatar Jul 03 '23 10:07 vercel[bot]

Probably I need to add some tests, but not sure. Need some advise. Also I am not 100% sure that I properly fixed open-api-doc. Please help me with this stuff. Thanks

dmitry-brazhenko avatar Jul 03 '23 15:07 dmitry-brazhenko

For further steps for improvement we can add a "panorama" filter here: 2023-07-03_19-35-48

dmitry-brazhenko avatar Jul 03 '23 17:07 dmitry-brazhenko

Hi! Do you have any ideas what can be improved in this PR? Can we merge it? :)

dmitry-brazhenko avatar Jul 04 '23 17:07 dmitry-brazhenko

@dmitry-brazhenko hello, I haven't gotten a chance to review the PR yet. Once I do and if there is nothing else to address, it will be merged. Thank you for the contribution

alextran1502 avatar Jul 04 '23 17:07 alextran1502

I think there is some issue with the recent rebase/merge, can you only include the changes to the panorama view?

alextran1502 avatar Jul 08 '23 20:07 alextran1502

After I ran "make api" - it resulted to multiple file changes

dmitry-brazhenko avatar Jul 08 '23 20:07 dmitry-brazhenko

These changes somehow reverting some of the changes that we made. How about you only include the changes in the server and mobile and leave the API generation for me?

alextran1502 avatar Jul 08 '23 20:07 alextran1502

Yes, I will do that

dmitry-brazhenko avatar Jul 08 '23 20:07 dmitry-brazhenko

@alextran1502 I reverted my attempts to merge main branch to my branch. Could you help me with merging please? Thanks

dmitry-brazhenko avatar Jul 08 '23 20:07 dmitry-brazhenko

@alextran1502 would you mind if merge docker compose improvement and MD fix in a separate PR?

dmitry-brazhenko avatar Jul 09 '23 18:07 dmitry-brazhenko

Fixes #2610 and #1630.

uhthomas avatar Jul 09 '23 20:07 uhthomas

If it is aspectRatio >= 2, we assume that it is a panorama

I think 360 panoramas should be detected more reliably in this PR. Currently, the code assumes that all images with an aspect ratio >= 2 are 360 panoramas.

But, for example:

  • Screenshots with landscape orientation should not be detected as 360 panoramas
  • Non-360 panoramas (for example, with cylindrical projection) should not be detected as 360 panoramas

I believe we should use the EXIF tag ProjectionType to detect 360 panoramas in addition to the aspect ratio check

brighteyed avatar Jul 16 '23 13:07 brighteyed

If it is aspectRatio >= 2, we assume that it is a panorama

I think 360 panoramas should be detected more reliably in this PR. Currently, the code assumes that all images with an aspect ratio >= 2 are 360 panoramas.

But, for example:

* Screenshots with landscape orientation should not be detected as 360 panoramas

* Non-360 panoramas (for example, with cylindrical projection) should not be detected as 360 panoramas

I believe we should use the EXIF tag ProjectionType to detect 360 panoramas in addition to the aspect ratio check

I agree. My google pixel photosphere images have the following projection type:

Projection Type                 : equirectangular

I also have photoshere images that are not complete 360 degree images so the aspect ratio is not 2:1.

CodeWithMa avatar Jul 16 '23 16:07 CodeWithMa

@CodeWithMa @brighteyed you're right. I fixed panorama detection. Now it consumes Exif and marks images by "panorama" only if there is a necessary exif tag.

@alextran1502 Could you help me with merging this PR?

Thanks

dmitry-brazhenko avatar Jul 23 '23 17:07 dmitry-brazhenko

Can you create another PR to consolidate the changes on the web and the server? Please put migrations into a single file. Once you've done that please ping me and I can help generating the API

alextran1502 avatar Jul 23 '23 18:07 alextran1502

Will go on in this PR: https://github.com/immich-app/immich/pull/3412.

Implemented Projectiontype as enum

dmitry-brazhenko avatar Jul 24 '23 09:07 dmitry-brazhenko