-
Notifications
You must be signed in to change notification settings - Fork 101
Upload photos from the library as JPEG instead of HEIC #767
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
SDK Size
|
private func assetJpgURL() -> URL? { | ||
guard let assetURL = assetURL else { return nil } | ||
guard let assetData = try? Data(contentsOf: assetURL) else { return nil } | ||
return try? UIImage(data: assetData)?.temporaryLocalFileUrl() |
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.
Not for this PR, but I did not know that temporaryLocalFileUrl
actually goes and converts the image to JPEG. We should probably rename this at some point.
I guess this is fast enough that we don't need any async call for this.
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.
Yeah I actually changed it and then reverted it. But I think we can do it already here. It makes sense to rename it on UIKit as well.
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.
I guess this is fast enough that we don't need any async call for this.
Yes it is quite fast, and is also only executed when an attachment is added to the composer
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.
Done ✅ Let me know WDYT
|
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.
LGTM ✅
🔗 Issue Link
#759
🎯 Goal
Send photos from the library as JPEG instead of HEIC to make sure other platforms can show the images correctly.
🛠 Implementation
We now convert the HEIC image to JPG when adding it to the composer.
This approach is what we do when sending photos from the Camera. With this change, we are also consistent with UIKit as well which follows the same approach.
🧪 Testing
Smoke testing around images
☑️ Checklist