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

Uploading edited pictures #348

Open
MrBull3t opened this issue Feb 1, 2023 · 1 comment
Open

Uploading edited pictures #348

MrBull3t opened this issue Feb 1, 2023 · 1 comment

Comments

@MrBull3t
Copy link

MrBull3t commented Feb 1, 2023

Hi,

When uploading pictures that have been edited using iOS build in features, BSimagepicker uploads the original image without the edits. Anyone know if there is an option to turn this of or a way to upload the picture as is, with the edits?

Much appreciated!

@leqwiser
Copy link

leqwiser commented Feb 8, 2024

Hi, you can use this extension to retrieve edited images, especially "options.version" responsible for what image retrieve (current - edited, original - original)
I didn't find better solution

extension PHAsset {
    func toUIImage() -> UIImage? {
        
        var image: UIImage?
        let manager = PHImageManager.default()
        let options = PHImageRequestOptions()
        
        options.isSynchronous = true
        options.version = .current
        options.deliveryMode = .highQualityFormat
        options.isNetworkAccessAllowed = true
        
        PHImageManager.default().requestImage(for: self,
                                              targetSize: PHImageManagerMaximumSize,
                                              contentMode: .default,
                                              options: options) { requestedImage, info in
            image = requestedImage
        }
        
        return image
    }
    
}

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

No branches or pull requests

2 participants