-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
Conversation
mobile/lib/utils/panorama_util.dart
Outdated
final result = await checkIfPanorama(file); | ||
|
||
// Update the metadata if it is not updated | ||
if (file.isPanorama() == null && file.canEditMetaInfo) { |
There was a problem hiding this comment.
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
mobile/lib/models/file/file.dart
Outdated
mediaUploadData.isPanorama = checkPanoramaFromEXIF(null, exifData); | ||
|
||
try { | ||
final xmpData = XMPExtractor() | ||
.extract(mediaUploadData.sourceFile!.readAsBytesSync()); | ||
mediaUploadData.isPanorama = checkPanoramaFromXMP(xmpData); | ||
} catch (_) {} | ||
|
||
mediaUploadData.isPanorama ??= false; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.