immich icon indicating copy to clipboard operation
immich copied to clipboard

fix(mobile): handle Live/Motion Photos aspect ratio mismatch

Open Coooolfan opened this issue 9 months ago • 3 comments
trafficstars

Description

Display the video portion of Live/Motion Photos in their correct aspect ratio on mobile devices.

In previous versions, the program did not account for cases where the video portion and photo portion of Live/Motion Photos had different aspect ratios (#16120), resulting in stretched video display.

You can find the original error recording and test photos in #16120

How Has This Been Tested?

You can reproduce this by uploading a Live/Motion Photo with different aspect ratios between its video and photo portions, and then trying to view the video in the App. The original error and file can be seen in the Issues mentioned above.

I don't have an iOS device, so I'm not certain about its functionality on iOS devices. (In any unexpected situations, such as incorrect video aspect ratio detection, the code will not attempt to modify the original ratio, meaning it will display the video using the static photo's aspect ratio, just like before)

Screenshots

BeforeAfter

ScreenRecord

ScreenRecord

Checklist:

  • [x] I have performed a self-review of my own code
  • [x] I have made corresponding changes to the documentation if applicable
  • [x] I have no unrelated changes in the PR.
  • [ ] I have confirmed that any new dependencies are strictly necessary.
  • [ ] I have written tests for new code (if applicable)
  • [x] I have followed naming conventions/patterns in the surrounding code
  • [ ] All code in src/services uses repositories implementations for database calls, filesystem operations, etc.
  • [ ] All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services)

Coooolfan avatar Feb 20 '25 15:02 Coooolfan

Hello, do you have a sample LivePhotos asset that is causing the issue?

alextran1502 avatar Feb 20 '25 15:02 alextran1502

Sure, i uploaded it on #16120 Or https://drive.google.com/file/d/1-aVjQIpGB3QwcLMTV8sp4MAIp1JkVIRn/view?usp=sharing

Coooolfan avatar Feb 20 '25 15:02 Coooolfan

This change causes the issue of wrong aspect ratio on playing a local video on iPhone

alextran1502 avatar Feb 20 '25 15:02 alextran1502