flutter_image_compress icon indicating copy to clipboard operation
flutter_image_compress copied to clipboard

Stop reading file since a wrong offset may cause an infinite loop

Open tiago-alves opened this issue 5 years ago • 5 comments

Hi,

I am trying to use this library to fix the camera rotation issue, but everytime I call FlutterImageCompress.compressWithList I receive the following message. The same happens if I call compressWithFile.

W/ExifInterface( 6731): Skip the tag entry since tag number is not defined: 2 W/ExifInterface( 6731): Stop reading file since a wrong offset may cause an infinite loop: 0 I/chatty ( 6731): uid=10065(com.example.simpleiddemoapp) pool-1-thread-3 identical 2 lines W/ExifInterface( 6731): Stop reading file since a wrong offset may cause an infinite loop: 0

I am using Visual Studio Code, and testing the application with my connected Android Device, version 8.1.0.

Thanks

tiago-alves avatar Aug 20 '19 14:08 tiago-alves

I may not be able to solve this problem without the information related to the image. I can try to upload the image as an attachment to this issue. I will try to solve it.

If it is not convenient to pass the attachment, you can send the image to me by email. [email protected]

CaiJingLong avatar Aug 27 '19 00:08 CaiJingLong

I had this issue too Stop reading file since a wrong offset may cause an infinite loop: 0

the image is from a standard library imagepicker.pickImage().

could you please try reproduce using a file picked from the above?

NewITCorp avatar Sep 01 '19 03:09 NewITCorp

I'm using the same library "image_picker: ^0.6.1+4" method:

ImagePicker.pickImage(source: ImageSource.camera)

getting a File, and having the same error

Stop reading file since a wrong offset may cause an infinite loop: 0

XgotecX avatar Sep 01 '19 20:09 XgotecX

I also had this problem on android, what I was doing is I was calling await File(path).readFromBytes twice:

  1. in function where I get orientation in order to determine what should be rotate's value
  2. in compressImageFile function What I did to fix it: final List<int> bytes = await File(path).readAsBytes(); and gave this variable in arguments of functions, so now I am calling await File(path).readFromBytes just once. This fixed my problem.

izabekz avatar Sep 09 '19 07:09 izabekz

I'm using the same library "image_picker: ^0.6.1+4" method:

var image = await ImagePicker.pickImage(source: ImageSource.camera)
&
var image = await ImagePicker.pickImage(source: ImageSource.gallery)

getting a File, and having the following error

ioctl c0044901 failed with code -1: Invalid argument Stop reading file since a wrong offset may cause an infinite loop: 0

rickchen1004 avatar Sep 30 '19 05:09 rickchen1004