From 605fc27dba996d90a19c309180ff93c8cb5e55c9 Mon Sep 17 00:00:00 2001 From: Gustavo Contreiras Date: Sun, 21 Apr 2019 01:29:04 -0300 Subject: [PATCH] Set maxWidth and maxHeight on pickImage() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you don't do that, many devices won't show image thumbnail after taking picture with the native camera using rear view (because resolution / size is too big). https://dustinstout.com/instagram-sizes/ "For Instagram landscape images, the smallest I have tested on was at 1920×1080 which Instagram then displayed at 600×337. As it turns out, though, Instagram ended up storing a version that is 1080×607." "Vertical images (or portrait) will display at a maximum of 480×600 (or 960×1200 for retina display). However it looks like Instagram is storing the photos at a maximum of 1080×1350 on its servers." --- lib/upload_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upload_page.dart b/lib/upload_page.dart index cecabe4..05f5564 100644 --- a/lib/upload_page.dart +++ b/lib/upload_page.dart @@ -153,7 +153,7 @@ class _Uploader extends State { onPressed: () async { Navigator.pop(context); File imageFile = - await ImagePicker.pickImage(source: ImageSource.camera); + await ImagePicker.pickImage(source: ImageSource.camera, maxWidth: 1920, maxHeight: 1350); setState(() { file = imageFile; });