@@ -242,9 +242,13 @@ class CameraView: UIView {
242
242
self ? . camera. previewView. alpha = 1
243
243
} )
244
244
}
245
- } , onSuccess: { [ weak self] imageData, thumbnailData in
245
+ } , onSuccess: { [ weak self] imageData, thumbnailData, dimensions in
246
246
DispatchQueue . global ( qos: . default) . async {
247
- self ? . writeCaptured ( imageData: imageData, thumbnailData: thumbnailData, onSuccess: onSuccess, onError: onError)
247
+ self ? . writeCaptured ( imageData: imageData,
248
+ thumbnailData: thumbnailData,
249
+ dimensions: dimensions,
250
+ onSuccess: onSuccess,
251
+ onError: onError)
248
252
249
253
self ? . focusInterfaceView. resetFocus ( )
250
254
}
@@ -289,6 +293,7 @@ class CameraView: UIView {
289
293
290
294
private func writeCaptured( imageData: Data ,
291
295
thumbnailData: Data ? ,
296
+ dimensions: CMVideoDimensions ,
292
297
onSuccess: @escaping ( _ imageObject: [ String : Any ] ) -> ( ) ,
293
298
onError: @escaping ( _ error: String ) -> ( ) ) {
294
299
do {
@@ -298,7 +303,9 @@ class CameraView: UIView {
298
303
" size " : imageData. count,
299
304
" uri " : temporaryImageFileURL. description,
300
305
" name " : temporaryImageFileURL. lastPathComponent,
301
- " thumb " : " "
306
+ " thumb " : " " ,
307
+ " height " : dimensions. height,
308
+ " width " : dimensions. width
302
309
] )
303
310
} catch {
304
311
let errorMessage = " Error occurred while writing image data to a temporary file: \( error) "
0 commit comments