ObsidianX / 3dstools

Tools for extracting and packing resources found in 3DS games
51 stars 15 forks source link

Get a struct.error when pack png to bflim #11

Closed FlameBeam closed 7 years ago

FlameBeam commented 7 years ago

Sorry for my bad English first. I'm hacking Yoshi's Wooly World. When I pack the png, I get a struct error:

py -3 bflim.py -c B293EF93-org.png new.bflim
Traceback (most recent call last):
  File "bflim.py", line 835, in <module>
    bflim.save(args.bflim_file)
  File "bflim.py", line 297, in save
    FLIM_UNKNOWN2, FLIM_MULTIPLIER, FLIM_UNKNOWN3)
struct.error: argument for 's' must be a bytes object
Tyulis commented 7 years ago

Do you use Python 2 or 3?

FlameBeam commented 7 years ago

It's run in Python 3.6, installed the vc2, struct and numpy.

Tyulis commented 7 years ago

It is made for Python2. To use it on Python3, try to edit these lines (at the beginning of the file):

FLIM_HEADER_MAGIC = "FLIM" -> FLIM_HEADER_MAGIC = b"FLIM"
IMAG_HEADER_MAGIC = "imag" -> IMAG_HEADER_MAGIC = b"imag"
FlameBeam commented 7 years ago

well, I will try it, thanks!

Tyulis commented 7 years ago

If it works, you can close the issue.

FlameBeam commented 7 years ago

Oh, I'm sorry I forgot it.