image_crop
image_crop copied to clipboard
Poor quality during crop
When I take a picture, the image have a good quality, but when I try to use it in Crop, it becomes completely blurry.
Here are two screenshots of the image in the camera and during the Crop:
This is on emulator (Pixel 4 API 30) but I have the same issue on my physical device (OnePlus 9 Pro).
You can find my code here
on the demo example/lib/main.dart
:
Future<void> _openImage() async {
final pickedFile =
await ImagePicker().pickImage(source: ImageSource.gallery);
final file = File(pickedFile?.path);
final sample = await ImageCrop.sampleImage(
file: file,
preferredSize: context.size?.longestSide.ceil(),
);
_sample?.delete();
_file?.delete();
setState(() {
_sample = sample;
_file = file;
});
}
replace to
Future<void> _openImage() async {
final pickedFile =
await ImagePicker().pickImage(source: ImageSource.gallery);
final file = File(pickedFile?.path);
// final sample = await ImageCrop.sampleImage(
// file: file,
// preferredSize: context.size?.longestSide.ceil(),
// );
//
// _sample?.delete();
_file?.delete();
setState(() {
_sample = file; // direct use origin file
_file = file;
});
}
I had the same issue on android, the cropped image were twice smaller than the preferredSize
value.
this PR fixed it #75