cannot decode Clash Royale sc files

Đang mở
#49 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

Start with xc​​oder/features/sc/decode.py and xc​​oder/features/cut_sprites.py, especially render_objects where the traceback shows the failure while saving shape 0. Reproduce with 55_CannoneerTaunt_FG.sc and inspect the generated shape dimensions; done means the SC file is processed without the Pillow crash and the expected sprite output is produced.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

what I did:

  • placed 55_CannoneerTaunt_FG.sc from Clash Royale apk into In-Compressed, then ran the program.
    => choosing 1 does nothing, choosing 3 crashes. (logs below in code tags)
  • I also placed the same file into In-Decompressed
    => choosing 1 or 3 does nothing.
  • I tried with other SC files from the same apk too.
-----------------------------------------------------------------------------------------------------------------------
Your choice: 1
-----------------------------------------------------------------------------------------------------------------------
[INFO] Completed in 0.00 seconds!
Press Enter to continue...
-----------------------------------------------------------------------------------------------------------------------
Your choice: 3
-----------------------------------------------------------------------------------------------------------------------
[INFO] File: 55_CannoneerTaunt_FG.sc. Collecting information...
[INFO] ZSTD compression detected

[0%] Cutting sprites... (1/208)[ERROR] ERROR! (builtins.SystemError: tile cannot extend outside image)
Traceback (most recent call last):

  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\ImageFile.py", line 643, in _save
    fh = fp.fileno()
         └ <PIL.PngImagePlugin._idat object at 0x000002207B92ABA0>

AttributeError: '_idat' object has no attribute 'fileno'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code

  File "C:\src\XCoder-2.7.6\xcoder\__main__.py", line 44, in <module>
    main()
    └ <function main at 0x000002207AE3A200>

  File "C:\src\XCoder-2.7.6\xcoder\__main__.py", line 34, in main
    handler()
    └ <function decode_and_render_objects at 0x000002207B86DEE0>

> File "C:\src\XCoder-2.7.6\xcoder\features\sc\decode.py", line 78, in decode_and_render_objects
    render_objects(swf, objects_output_folder)
    │              │    └ WindowsPath('SC/Out-Sprites/55_CannoneerTaunt_FG')
    │              └ <xcoder.swf.SupercellSWF object at 0x000002207B929400>
    └ <function render_objects at 0x000002207B86DF80>

  File "C:\src\XCoder-2.7.6\xcoder\features\cut_sprites.py", line 46, in render_objects
    rendered_shape.save(f"{output_folder}/shapes/{shape.id}.png")
    │              │       │                      │     └ 0
    │              │       │                      └ <xcoder.objects.shape.shape.Shape object at 0x000002207B929A90>
    │              │       └ WindowsPath('SC/Out-Sprites/55_CannoneerTaunt_FG')
    │              └ <function Image.save at 0x000002207B8BA8E0>
    └ <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>

  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\Image.py", line 2581, in save
    save_handler(self, fp, filename)
    │            │     │   └ 'SC\\Out-Sprites\\55_CannoneerTaunt_FG/shapes/0.png'
    │            │     └ <_io.BufferedRandom name='SC\\Out-Sprites\\55_CannoneerTaunt_FG/shapes/0.png'>
    │            └ <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>
    └ <function _save at 0x000002207BA12B60>
  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\PngImagePlugin.py", line 1492, in _save
    ImageFile._save(
    │         └ <function _save at 0x000002207B87A200>
    └ <module 'PIL.ImageFile' from 'C:\\Users\\<username>\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\xcoder-bYim4_8o-py3.13\\Lib\\...
  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\ImageFile.py", line 647, in _save
    _encode_tile(im, fp, tile, bufsize, None, exc)
    │            │   │   │     └ 65536
    │            │   │   └ [_Tile(codec_name='zip', extents=(0, 0, 0, 0), offset=0, args='RGBA')]
    │            │   └ <PIL.PngImagePlugin._idat object at 0x000002207B92ABA0>
    │            └ <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>
    └ <function _encode_tile at 0x000002207B8A47C0>
  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\ImageFile.py", line 665, in _encode_tile
    encoder.setimage(im.im, extents)
    │       │        │  │   └ (0, 0, 0, 0)
    │       │        │  └ <property object at 0x000002207B8B0F90>
    │       │        └ <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>
    │       └ <method 'setimage' of 'ImagingEncoder' objects>
    └ <ImagingEncoder object at 0x000002207AF97EA0>

SystemError: tile cannot extend outside image

[INFO] Completed in 0.27 seconds!
Press Enter to continue...
Ngôn ngữ chính
Python
Star
80
Fork
7
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của xcoder-tool/XCoder

Tất cả issue của xcoder-tool/XCoder

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.