I am using image_picker 0.8.6+1 in my app for capturing camera image. When I capture image app suddenly crash without any exception. It's working fine on Android 13 Samsung. But it's causing a crash on Android 10 OPPO phone. I am unable to catch exception. I tried with try catch block but no luck.
Here is my code.
profileImagesList.add(await _picker.pickImage(
source: ImageSource.camera,
maxHeight: 600,
maxWidth: 400,
preferredCameraDevice: CameraDevice.front,
imageQuality: 10));
Related
I have implemented code which will allow me to access the camera in my flutter application and it is working perfectly when the app is opened on android, but the app crashes and throws an exception when I open the same, on Chrome on Mac!
I am using camera package from flutter docs to access the camera!
import 'package:camera/camera.dart';
The exception occurs at this line:
List<CameraDescription> cameras = await availableCameras();
I don't know whether camera package supports on web or not, so if this is the case, can anyone suggest me an alternative, which I can use in web and a way how to write a condition, like if the app opened on web then the alternative camerapreview, else (on android) camerapreview from camera package
Edit - when I accept the permission of camera on chrome, the light of the webcam blinks and then the app crashes and points to the above line showcasing exception occurs
I am using a PictureRecorder variable from the dart:ui package for creating an image with this line of code:
final _image =
await pictureRecorder.endRecording().toImage(size, (size * 1.1).toInt());
It works fine with Flutter Android, Flutter iOS and also Flutter Web. But I experienced a problem with Flutter Web, if it is opened with any mobile device (iOS and Android).
The problem is that endRecording doesn't create an "Instance of CkPicture". Instead it creates an "Instance of Minified:vs", whatever that means. But only on Flutter Web if you open with a mobile phone.
And ideas for a fix or a workaround?
Here's a complete example for this code for converting an image to a png
Round Image File
My flutter apps crash during development. It directly crash if I use this image.
My image that has error
Image.network(
'https://testpmcstorage.blob.core.windows.net/background-image/image7.jpeg',)
I'm trying to write a feature that allows a user to select an image from their gallery on iOS. I'm able to capture the image from the camera, but when I try to do the same from the image gallery, my app crashes.
I made sure that I'm using the latest version of the plugin (0.6.0), and have tried running the app both in the simulator and on my iOS device. I'm currently using an iPhone 8 simulator running iOS 12.4, and my device is an iPhone 7+, also on iOS 12.4
// opens the camera for use, works as expected
// does not currently store the image anywhere, but I know why
void _showCamera() async {
var picture = await ImagePicker.pickImage(
source: ImageSource.camera
);
}
// this code crashes
void _showImageGallery() async {
var picture = await ImagePicker.pickImage(
source: ImageSource.gallery
);
}
If I call _showCamera() from my onTap: callback, the camera opens without issue. When I call _showImageGallery() from the exact same onTap: callback, the app crashes. I'd expect it to work the same since they're otherwise identical functions.
I think you missed adding the NSPhotoLibraryUsageDescription to the info.plist file
This issue exists on flutter stable channel. Switch to flutter beta channel to resolve this issue. Use this command to switch the flutter channel:
flutter channel beta
I get "Error initializing capture component: 0, 480, 360" when I try to run metaio SDK sample project on ios 6 simulator iphone. I was able to compile but I got the same error before and after the compile.How to solve this issue?
Metaio sdk
Error initializing capture component: 0, 480, 360
Error starting capture component
you might get the error message above when you try to run your application on iOS simulator.Please run on your ios device(iphone or ipad).You cannot take image via Mac's webcam from iPhone Simulator. For camera, you need to test it on a device.
if( m_metaioSDK )
{
m_metaioSDK->startCamera(0, 480, 360);
}