-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NegativeArraySizeException #2
Comments
Please don't post screenshots of error traces but the output text like:
Could you specify the Looking at the trace, it seems the input image is larger than what the tool could handle – what are the exact image dimensions (width and height)? More precisely, the result dimensions @4x the given input image are larger than what the tool could produce. I will improve the error reporting for the related cases in a future version of the tool, but it wouldn't make it process such images successfully. Note, this tool is meant for processing relatively small pixel-art graphics and is not a general image scaling tool. Could you share your use case for scaling very large images with xBRZ? |
The Test image size of 2608 x 4000 is 1.8M, and the file size after being enlarged by 4 times is 72M. Can you optimize the enlarged image in the later stage and make it smaller? thank you . |
2608×4000 scaled by a factor of 4 would be 16 times the original size = 166,912,000 pixels – well within the limits. However, it doesn't match the observed exception: NegativeArraySizeException: -1624375296. The last number as unsigned It could be the source image is not decoded properly by the Java Image I/O library. If the test image is not private, could you share it here? You may also try saving it as PNG to use as a source for the |
It does match:
It looks like you're trying to scale a 10432×16000 (and not a 2608×4000) image by a factor of 4 which exceeds the implementation limits: target dimension of 41728×64000. For comparison – the maximum target image dimension is about 46000×46000:
Not sure what you're up to, but xBRZ is not a compression algorithm. It is an upscaling algorithm originally meant for scaling up pixel-art graphics. |
Instead of NegativeArraySizeException throw OutOfMemoryException with message info about the cause: source dimensions and scale factor resulting in target size integer overflow.
Hello, a java.lang.NegativeArraySizeException exception was reported. Can this be fixed? Thanks
The text was updated successfully, but these errors were encountered: