color-thief-java icon indicating copy to clipboard operation
color-thief-java copied to clipboard

ArithmeticException when Image is too big

Open confile opened this issue 8 years ago • 1 comments

I tried your lib with a 7,8MB image. the operation I did was:

int[] result = ColorThief.getColor(bufferedImage, 0, true)

Here is the error I get:

   Line | Method
->>  252 | getPixelsFast    in de.androidpit.colorthief.ColorThief
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    183 | getColorMap      in     ''
|    127 | getPalette . . . in     ''
|     75 | getColor         in     ''
|    121 | save . . . . . . in majestella.admin.AdminImageItemController$$EPQQlXSS
|    198 | doFilter         in grails.plugin.cache.web.filter.PageFragmentCachingFilter
|     63 | doFilter . . . . in grails.plugin.cache.web.filter.AbstractFilter
|     53 | doFilter         in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
|     62 | doFilter . . . . in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
|     46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
|   1145 | runWorker . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run              in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run . . . . . .  in java.lang.Thread

confile avatar Oct 07 '15 12:10 confile

Sorry for the late response. I had an outdated e-mail address in my github account and just noticed that a few days ago when I worked on another github project.

I just tested the code with several images ranging from 10 to 66 MB and no exceptions were thrown.

If you send me the image that caused the exception, I can have a look at it.

SvenWoltmann avatar Aug 24 '17 14:08 SvenWoltmann