cannot decode Clash Royale sc files
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with xcoder/features/sc/decode.py and xcoder/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.
Written by the indexing model from the issue text.
Description
what I did:
- placed
55_CannoneerTaunt_FG.scfrom Clash Royale apk intoIn-Compressed, then ran the program.
=> choosing1does nothing, choosing3crashes. (logs below in code tags) - I also placed the same file into
In-Decompressed
=> choosing1or3does 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...
- Dominant language
- Python
- Stars
- 80
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xcoder-tool/XCoder
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
xcoder-tool/XCoder#84 ·
-
question
Difficulty 3/5 1-2 days Newbie friendliness 32/100
xcoder-tool/XCoder#35 · 1 comment ·
-
enhancement
xcoder-tool/XCoder#2 · 1 assignee ·
All issues in xcoder-tool/XCoder
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100