Closed migalv closed 1 year ago
Thank you for your kind words 🙏🏻. Feedbacks are never bothering us. That's how we can improve so please do.
Same on my side (iPhoneX). It crops the image a bit when capturing in portrait mode, but when is in landscape mode it saves the image in 3:4 instead of 16:9 and crops the image a lot on the sides.
I have notice that even I set the preferedOrientations to all, on the camera screen they are forced to portraitUp only. I guess this is done on the plugin level?
OK, I see https://github.com/Apparence-io/CamerAwesome/issues/241 where is explained the orientation problem as expected.
I have to mention on Pixel 6 the camera works super and saves the images as per the Camera Preview.
To be honest I was using the pre 1.0.0 version and was quite satisfied with it, but was pushed by the users to upgrade it as on that version we have an issue with saved images been bigger then the preview. I hope the issue with croped images on iOS will be solved soon.
Thank you in advance and thank you for the good job!
this is also the case for android devices. In my Pixel 6 pro the frame shown in preview is not he same in the frame in analysis mode the image is getting cropped from the bottom
Hi @g-apparence, do you know if there is any progress on that task? Thanks in advance!
Fast workaround for this problem is to use other delegate method to create image. CameraPictureController.m
- (void)captureOutput:(AVCapturePhotoOutput *)output didFinishProcessingPhoto:(AVCapturePhoto *)photo error:(NSError *)error {
selfReference = nil;
if (error) {
_completion(nil, [FlutterError errorWithCode:@"CAPTURE ERROR" message:error.description details:@""]);
return;
}
// Add exif data
ExifContainer *container = [[ExifContainer alloc] init];
[container addCreationDate:[NSDate date]];
// Save GPS location only if provided
if (_saveGPSLocation) {
CLLocationManager *locationManager = [CLLocationManager new];
CLLocation *location = [locationManager location];
[container addLocation:location];
}
NSData *data = photo.fileDataRepresentation;
UIImage *capturedImage = [UIImage imageWithCGImage:[UIImage imageWithData:data].CGImage
scale:1.0
orientation:[self getJpegOrientation]];
NSData *imageWithExif = [UIImageJPEGRepresentation(capturedImage, 1.0) addExif:container];
bool success = [imageWithExif writeToFile:_path atomically:YES];
if (!success) {
_completion(nil, [FlutterError errorWithCode:@"IOError" message:@"unable to write file" details:nil]);
return;
}
_completionBlock();
}
Hey @Alnik9 could you create a PR with this change, please? I would love to try it out!
I'm not sure how to change this in my code
@g-apparence Hey do you have any news on this being fixed?
Let me know if I can help in any way, I would be happy to contribute if I can.
Sorry didn't have time to work on this. As it seems someone found the solution this could be interesting to try this with the approval of our iOS master.
@Alnik9 would you create a PR with your changes?
Hello @g-apparence, I see that you guys are actively working on CamerAwesome again.
Did you have a chance to solve this? Is there a PR in development at the moment? I think this is a pretty big problem for the iOS camera.
@migalv This problem is very difficult to fix. On Android, cameraX handle the aspect ratio crop by itself, on iOS we need to do it manually so this is not perfect...
I will add the "help wanted" label if someone can help us on this bug... I think the fix provided by @Alnik9 just remove the aspect ratio cropping ... I can disable the crop with an option.
Currently here is a list of what works (if you can confirm it could be nice @migalv ):
So only portrait 4:3 not work, is it correct?
Ok so, new update @migalv !
I tried to make the portrait 4:3 work and I think I had found a solution 👍 I will try this solution tomorrow to know if it's a fix or not 👍
Hey great news @istornz thanks a ton!
Currently here is a list of what works (if you can confirm it could be nice @migalv ):
I surely can test it. Should I test it with the latest version or a certain PR. Let me know :)
@migalv Ok so I published the fix, I tested it on iPhone 14 Pro + iPhone X + iPad Pro 2018 it seems working on both portrait & landscape orientation.
If you can test on the branch fix/ios-aspect-ratio-4_3
it will be nice!
Steps to Reproduce
Expected results
The output pictures should look like the image shown in the camera preview.
Actual results
The output pictures are "cut".
Here are some examples when taking pictures with different aspect ratios
About your device
PS
BTW let me say again that I love the package, great work! I hope all my issues are not too bothering. I'm just trying to help 😅 let me know if I can help in any other way. Once all these issues are resolved I'll surely make a YouTube video on how to make the most out of CamerAwesome 1.0.0 because I truly believe that it's the best package for native camera integration.