Skip to content
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

compress-mcf.py - struct.error: 'i' format requires -2147483648 <= number <= 2147483647 #268

Open
Puddingpanzer opened this issue Apr 3, 2024 · 1 comment

Comments

@Puddingpanzer
Copy link

Puddingpanzer commented Apr 3, 2024

Hi, i'm trying to re-compress my just extracted skin1 folder without any changes and getting this error with Python 3.12:

compress-mcf.py .\skin1\images.mcf .\skin1\images_new.mcf .\skin1\Unsorted\
original-file incorrect magic!
size of TOC: 42880
number of files: 2680
data start: 42936
IMG ;1;8;12;4;1;1606336533;1;1;4356;1;420932218
IMG ;2;8;12;4;1;4028075487;1;1;4356;1;3052432344
Traceback (most recent call last):
  File "compress-mcf.py", line 118, in <module>
    struct_data = struct_data + struct.pack('<4siiiiiihhhh', type.encode("UTF-8"), file_id, always_8, zsize,
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: 'i' format requires -2147483648 <= number <= 2147483647

any advices how to fix?

@drivebyroma
Copy link

drivebyroma commented Feb 15, 2025

I guess you solved this problem, could you tell how? as I get the same error basically. I'm not a pro in python. I did manage to do startupscreen decompiling and compiling ok, but having problems with compress-mcf.py as I get the same error

C:\Trytwo>python compress-mcf.py .\skin1\images.mcf .\newfile\images.mcf .\skin1raw
original-file incorrect magic!
size of TOC: 42560
number of files: 2660
data start: 42616
IMG ;1;8;12;4;1;1606336533;1;1;4356;1;420932218
IMG ;2;8;12;4;1;4028075487;1;1;4356;1;3052432344
Traceback (most recent call last):
File "C:\Trytwo\compress-mcf.py", line 118, in
struct_data = struct_data + struct.pack('<4siiiiiihhhh', type.encode("UTF-8"), file_id, always_8, zsize,
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
max_pixel_count, always_1, hash_1, width, height, image_mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
always__1) + image_zlib + struct.pack('<i', hash_2)
^^^^^^^^^^
struct.error: 'i' format requires -2147483648 <= number <= 2147483647

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants