-
Notifications
You must be signed in to change notification settings - Fork 319
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
[IOS] FIX: Return original filename instead of FullSizeRender #990
Conversation
(IN TESTING) Add method to retrieve original photo/video instead of altered one. getTitleAsync now returns original filename instead of 'FullsizeRender'.
@@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
- (nullable NSString*)mimeType; | |||
- (BOOL)isAdjust; | |||
- (PHAssetResource *)getAdjustResource; | |||
- (PHAssetResource *)getUntouchedResource; |
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.
This seems to affect the file of Live Photos. What's the difference between them? Any specs?
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.
getAdjustResource return by default media with adjustments ( PHAssetResourceTypeFullSizePhoto/Video) if there are any.
getUntouchedResource will always return original asset (PHAssetResourceTypePhoto/*Video).
LivePhotos are not affected by this, because there are already dedicated methods to deal with them. For example, when retrieving filename of an asset, will check if media type is LivePhoto and use the dedicated method:
- (NSString *)originalFilenameWithSubtype:(int)subtype {
if (@available(iOS 9.1, *)) {
if ([self isLivePhoto] && subtype == PHAssetMediaSubtypePhotoLive) {
return [self getLivePhotosResource].originalFilename;
}
}
PHAssetResource *resource = [self getUntouchedResource];
if (resource) {
return resource.originalFilename;
}
getLivePhotosResource currently will always returns original video asset ( PHAssetResourceTypePairedVideo), and there are no method to retrieve the asset with adjustments, hence we could add this possibility.
@xick Could you add the CHANGELOG entry and update the branch? |
Done. I don't know if I should have pushed a single commit instead, sorry but I'm not familiar with PR. |
You don't have to, we will make a squash merge. |
Hello @AlexV525, I apologize for the ping and the forbidden question. Do you know when we can expect a new release with the library? Thank you for your work! |
Now. :) |
@AlexV525 Thanks Alex! I appreciate you so much |
@AlexV525 Using latest version of library still getting FullSizeRender.jpg instead HEIC image and original file name. This happens when i use portrait image in iOS. |
@xick Is your fix managed to cover the above case? |
@patelnirav48 @AlexV525 it works fine on my end for getting the correct file name for Portrait mode on Iphone 12 Pro |
@patelnirav48 Please share details so everyone at here can probably help to sort out the case. |
Device - iPhone XR |
@alextran1502 @AlexV525 I'm using latest version of wechat_assets_picker, and that also using latest version of photo manager 3.0.0.. When i pick from gallery its return FullSizeRender.jpg.. even extension get changed with file name. |
I was watching this PR and got notification so I checked from my side and indeed in Immich I can see that portrait photo I just took and backed up is indeed IMG_0327.HEIC |
So you're accessing with |
Accessing as .originFile |
I can reproduce this using iPhone 12 with iOS 17.3.1. |
@AlexV525 Immich was still using 3.0.0-dev5, I wonder if you can test with that version to see if you can still reproduce this? |
I'm using 3.0.0. |
@alextran1502 I tested with 3.0.0-dev5 its working fine (It's keeping file name and extension as it is). Just it's removing portrait background blur effect from the image. CC. @AlexV525 |
So are you running the same issue using the 3.0.0? It includes changes from dev.5 for sure. |
In 3.0.0, It's not working.. but 3.0.0-dev5 its working, but just it's removing portrait background blur effect from the image. |
You can use |
Ah sorry, you made changes already before few hours, so its working. https://prnt.sc/Gp3PCJlpkfvJ. Thanks |
Related Issues:
Fixes #976
Fixes immich-app/immich#4088