From 4921d6d61d19f48c366f5c9cebcf37fecf86a0be Mon Sep 17 00:00:00 2001 From: Doug Date: Tue, 6 Jul 2021 10:41:47 +0100 Subject: [PATCH] Generate video thumbnails with the correct orientation. --- CHANGES.rst | 1 + Riot/Modules/MediaPicker/MediaPickerViewController.m | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 04c0012ef3..5837d3a378 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,7 @@ Changes to be released in next version 🐛 Bugfix * VoIP: Do not present ended calls. * More fixes to Main.storyboard layout on iPhone 12 Pro Max (#4527) + * Media Picker: Generate video thumbnails with the correct orientation (#4515). ⚠️ API Changes * diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.m b/Riot/Modules/MediaPicker/MediaPickerViewController.m index 6b7725a111..d08e6ab172 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.m +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.m @@ -736,6 +736,7 @@ - (void)validateSelectedVideo:(NSURL*)selectedVideoURL responseHandler:(void (^) // create a thumbnail for the first frame AVAsset *asset = [AVAsset assetWithURL:selectedVideoURL]; AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset]; + generator.appliesPreferredTrackTransform = YES; CGImageRef thumbnailRef = [generator copyCGImageAtTime:kCMTimeZero actualTime:nil error:nil]; // set thumbnail on validationView