Skip to content

ArrayOutOfBoundsException when image width not multiple of 8 #1

Description

@hpihkala

Hi, looks like the utility crashes when the image width is not a multiple of 8 due to a bug in the nested for loops:

height: 1170 width: 1170 total byte length: 173222
pixel offset: 62
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 173160
at org.orphanware.App.convertBMP(App.java:132)
at org.orphanware.App.main(App.java:87)

Easiest workaround is to add or remove a couple of pixels to your image width so that it is exactly divisible by 8.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions