fluttercandies / flutter_image_compress

flutter image compress
MIT License
633 stars 214 forks source link

Prevent OOM when getting EXIF rotationdegrees for large image #246

Closed basveenema closed 1 year ago

basveenema commented 1 year ago

We're experiencing an Out Of Memory exception on android for large image files when compressing an image by calling compressAndGetFile and autoCorrectionAngle = true. It is caused by val bytes = File(file).readBytes(). Exif.getRotationDegrees also has a method for files which fixes the OOM.