Closed dmitry-weirdo closed 3 years ago
This is an example image on which the exception occurs.
@dmitry-weirdo, thank you for reporting this.
There's definitely some division happening, and I may have overlooked some possible division by zero situations. I can't address this immediately, but I'll try to follow-up on this as soon as I can.
@coobird Any progress on this issue?
@dmitry-weirdo, I was hoping to take a look at it this weekend. I'll try to take a quick look at it now as well :)
Reproduced issue; happens when .width
or .height
is called.
Hope to have a fix out this weekend.
Fixed in 0.4.13.
Expected behavior
Thumbnail is generated without any exceptions.
Actual behavior
Lots of jpeg files (not all!) fail with the following exceptions:
Steps to reproduce the behavior
I ran into constant OOM on big files (namely the 6000*4000 jpeg), so I ran the import with
-Dthumbnailator.conserveMemoryWorkaround=true
. This prevents OOM, but big percentage of files fail with the aforementioned ArithmeticException. Most probably these are big files that will otherwise fail with OOM.The thumbnail generation code is:
Environment
OS vendor and version: Linux version 4.14.193-113.317.amzn1.x86_64 (mockbuild@koji-pdx-corp-builder-60005) (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP Thu Sep 3 19:08:08 UTC 2020
JDK vendor and version: openjdk version "11" 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
Thumbnailator version: 0.4.12