Skip to content

Commit

Permalink
Fix invert ArrayIndexOutOfBoundsException
Browse files Browse the repository at this point in the history
Closes qzind#705
  • Loading branch information
tresf authored Sep 3, 2020
1 parent 62afc68 commit 0c18543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qz/utils/ColorUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static boolean isBlack(BufferedImage bi) {
* @return New inverted BufferedImage
*/
public static BufferedImage invert(BufferedImage bi) {
BufferedImage inverted = new BufferedImage(bi.getWidth(), bi.getWidth(), BufferedImage.TYPE_INT_ARGB);
BufferedImage inverted = new BufferedImage(bi.getWidth(), bi.getHeight(), BufferedImage.TYPE_INT_ARGB);
for (int y = 0; y < bi.getHeight(); y++) {
for (int x = 0; x < bi.getWidth(); x++) {
int pixel = bi.getRGB(x, y);
Expand Down

0 comments on commit 0c18543

Please sign in to comment.