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

support livp photos #8645

Closed
wants to merge 1 commit into from
Closed

support livp photos #8645

wants to merge 1 commit into from

Conversation

oldwang12
Copy link

Uploading photos in the format of livp through the iOS immich app will result in an error on the server.

[Nest] 1  - 04/08/2024, 1:22:53 PM   ERROR [AssetService] Unsupported file type IMG_4372.livp

I found that the code does not have the livp format here. Can you add the livp format here?

@mmomjian
Copy link
Contributor

mmomjian commented Apr 9, 2024

This PR is not complete - at a minimum it needs to be added to the spec.ts file as well.

what testing have you done to confirm that the image libraries used in Immich support LIVP?

@alextran1502
Copy link
Contributor

Hello, thank you for the PR! Have you tested that the file is supported, i.e., the thumbnail gets generated and metadata is read correctly?

@mertalev
Copy link
Contributor

The livp format is apparently an archive containing a JPEG and a MOV file. This would require more than just adding it to the list.

@SandiyosDev
Copy link
Contributor

Some useful links for developing .LIVP support:

I believe a simple handler could be developed to extract these files, generate previews, catalog EXIF data, and perhaps include conversion features in the future. The above references should be helpful for anyone interested in working on this.

@SandiyosDev
Copy link
Contributor

If any maintainers would like to assist me in working on this, please reference the right files and add potential boilerplates so I could try implementing this filetype on my end.
It would be a good starter for me to get familiar with the codebase.

@mertalev
Copy link
Contributor

Thanks for offering to help! The most relevant file is the metadata service.

We handle something similar for motion photos: the video is embedded into the image so we extract it as a new asset and link the two.

But there's an additional wrinkle in this case since the image portion also needs to be extracted. Every image and every video is its own asset, so thumbnail generation assumes the originalPath can be directly read, storage template can move that asset, etc. We could create a new asset for the image portion, link that to the video portion and hide the livp asset.

@SandiyosDev
Copy link
Contributor

SandiyosDev commented Apr 13, 2024

Thanks for offering to help! The most relevant file is the metadata service.

We handle something similar for motion photos: the video is embedded into the image so we extract it as a new asset and link the two.

But there's an additional wrinkle in this case since the image portion also needs to be extracted. Every image and every video is its own asset, so thumbnail generation assumes the originalPath can be directly read, storage template can move that asset, etc. We could create a new asset for the image portion, link that to the video portion and hide the livp asset.

I think my scenario is an edge case. I primarily bind mount external libraries and use Immich for cataloging and remote access. So, in my mind, automatically, I went with the route of extracting assets, cataloging info, generating previews, deleting the extracted assets, and linking the previews and metadata to the original. However, I'm less familiar with the process for directly imported files and the specific code that handles them.

Ideally, I'd prefer .LIVP files to be handled as-is upon upload, without converting them into new assets. But I'm unclear on which part of the codebase deals with this or the standard procedures for managing new file types like this. Could you point me to a previous pull request or any documentation that discusses how similar cases have been handled? This would really help me figure out the best approach

@mertalev

@SandiyosDev
Copy link
Contributor

Also, I believe .photoasset can be treated the same way as .LIVP

@mertalev
Copy link
Contributor

This PR is probably the most closely related.

We generally try to minimize the number of "special cases" to make job processing cleaner and more robust, so this is why I suggested making separate assets for the image and video. Using the livp asset as the image portion would have implications in other jobs as well as for things like asset serving.

@jrasm91 has the most context on live/motion photos, so they might have more thoughts on this.

@SandiyosDev
Copy link
Contributor

SandiyosDev commented Apr 13, 2024

he previews and metadata to the original. However, I'm less familiar with the process for directly imported files and the

Thanks @mertalev, that helps a lot!
While I'm waiting for his response, how should external libraries with LIVP be treated then? does that follow the earlier linking process that I mentioned, or is there also a pull reference for those cases?
Perhaps it would belong to #8721 instead?

@mertalev
Copy link
Contributor

The extracted videos for motion photos are put in the encoded-videos folder, separate from the external library. #8512 is a recent PR related to this that was later split up. I imagine it'd be similar in this case except that the image would go in the thumbs folder.

@mertalev
Copy link
Contributor

mertalev commented May 4, 2024

Closing this PR since it doesn't address the actual implementation needed to support this format.

@mertalev mertalev closed this May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants