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

[mob][panorama] update panorama checking mechanism #2532

Merged
merged 9 commits into from
Aug 9, 2024

Conversation

prateekmedia
Copy link
Member

Description

Panorama was getting checked every time and was not getting cached. This PR creates mediaType to classify image whether it's panorama or not.

  • If a image can be panorama (Any side Dimensions >8000px and 2 * height >= width or 2 * width >= height) it will try to check metadata if image could be panorama.
  • Opening details pane will check metadata if image is panorama or not.
  • Gyroscope button is introduced along with proper panoramic view instead of 360* view for Images that have Cropped metadata.

@prateekmedia prateekmedia requested a review from ua741 July 24, 2024 06:36
final result = await checkIfPanorama(file);

// Update the metadata if it is not updated
if (file.isPanorama() == null && file.canEditMetaInfo) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file.canEditMetaInfo check can happen at the start of the method

Comment on lines 184 to 192
mediaUploadData.isPanorama = checkPanoramaFromEXIF(null, exifData);

try {
final xmpData = XMPExtractor()
.extract(mediaUploadData.sourceFile!.readAsBytesSync());
mediaUploadData.isPanorama = checkPanoramaFromXMP(xmpData);
} catch (_) {}

mediaUploadData.isPanorama ??= false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These check should only happen for Normal Images (not for Live photo and video).
Also, if exifSays it's panorama, no need to check for xmp?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the first part, it is under a if where it only runs for file type image, hence file type live photo and video are eliminated.

@prateekmedia prateekmedia merged commit 4d8e800 into main Aug 9, 2024
3 of 4 checks passed
@prateekmedia prateekmedia deleted the mobile-panorama-fix branch August 9, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants