PolyhedralDev / Terra

Voxel world generation modding platform
MIT License
663 stars 88 forks source link

Large image support #373

Closed Gal1leooo closed 1 year ago

Gal1leooo commented 2 years ago

Describe the issue

There is an error when i try to generate a world using provider type: image The image is 25000x25000 Error: https://mclo.gs/MIY81FW

The files were .yml but i can't upload them, so i converted in txt image.txt pack.txt

solonovamax commented 2 years ago

Send the entire pack folder, including the image you used. Zip all the files, so you can upload them as a single file.

astrsh commented 2 years ago

I believe the issue is with how the image is being loaded via Java's BufferedImage class, specifically that exception seems to be thrown when images are too large to be stored in memory (since each image sample point is stored in an array limited by the max integer size)

A solution would be to implement image stitching (which would be invisible to users) in the backend for images that are too large, such that they can be loaded into memory as multiple smaller BufferedImages.

astrsh commented 2 years ago

I would recommend implementing on top of https://github.com/PolyhedralDev/Terra/pull/356 if anyone else wishes to work on this

Gal1leooo commented 2 years ago

Thanks so much for the support! Still need the full pack? In case I'd prefer to send it in private. If I may ask, how soon will this bug be fixed?

nihiluis commented 1 year ago

hope #356 doesnt get stale. rn, I think the image provider is not usable

astrsh commented 1 year ago

Stitching implemented in 6efff02c19ef089d5d74df5ce4f30067afcab9f8