DrSuperGood/blp-iio-plugin

when blp width or height bigger then 512px .some problem happend

PhoenixZeng opened this issue · 2 comments

1.the blp size will force to 512 which length then 512px
2.some color maybe lost

That part of the code probably needs updating. The plugin was originally written before Warcraft III Reforged added support for loading mipmap levels larger than 512 pixels in any dimension.

Use the following code to avoid problem 1:

ImageOutputStream outputStream = ImageIO.createImageOutputStream(newFile);
ImageWriter writer = ImageIO.getImageWritersByFormatName(ext).next();
BLPWriteParam blpWriteParam = new BLPWriteParam();
blpWriteParam.setScaleOptimization(BLPWriteParam.ScaleOptimization.NONE);
writer.setOutput(outputStream);
writer.write(null, new IIOImage(bufferedImage, null, null), blpWriteParam);
writer.dispose();

Problem 2: I seem to have fixed it, but I forgot the corresponding code