crashinvaders/gdx-texture-packer-gui

Run packer in command line bug?

powof2 opened this issue · 5 comments

powof2 commented

Is this a bug? the ATLAS generated by this GUI tool is fine, but the ATLAS generated by the command line tool has a problem: the input image will be scaled, here is the scenario:

Target atlas size is 2048x2048, input texture is 2048x1536, with this GUI tool, uncheck the Edge Padding then pack we'll get the result atlas as expected. but with the command line tool, the input texture inside final atlas will be scaled a litte (2 or 4 pixels smaller i believe), this is really annoying.

the command line tool can be found here https://libgdx.com/wiki/tools/texture-packer, i followed the instructions and modified the json config file (edgePadding: false)

Thank you.

powof2 commented

BTW, can this GUI tool export packer settings to a json file which can be used by the command line tool? that will be really convenient. Thank you.

If you're using the command line tool, you probably want to see https://github.com/libgdx/libgdx/issues instead and provide details of how to reproduce the issue. I've tried with the following files and command and didn't experience any scaling.

  • robin.png
  • settings.json (remove .txt extension from download)
  • java -jar runnable-texturepacker.jar in . test settings.json

Output file: test.png

powof2 commented

Hi Frosty-J,
You're correct, i tried again with the command line tool. it produces the final atlas as expected.

I'm going to check the program that runs this command line tool, maybe the problem is there.

By the way, why i failed to run your example command line? i have to use this:
java -cp runnable-texturepacker.jar com.badlogic.gdx.tools.texturepacker.TexturePacker . test

Not sure. I'd expect Java to automatically be able to use the main class (com.badlogic.gdx.tools.texturepacker.TexturePacker).

I don't think it's possible to export a json configuration that is compatible with the original CLI tool. The GUI app uses very different input file approach and at this point runs modified version of the original libGDX texture packer code.

The CLI support for the app was on the roadmap for many years, it's just didn't seem like there's much of demand for the future. I will see if it's possible to integrate a very simple CLI pack command just to begin the process of implementing CLI automation.