Mino260806 / miwtool

A tool for manipulating Redmi Watch 2 Lite watchface files
GNU General Public License v3.0
36 stars 8 forks source link

encode_wfeditor IndexError: is out of bounds for axis 0 with size 3 #4

Closed Domenick90 closed 1 year ago

Domenick90 commented 1 year ago

Hello! In new build tools im see error with encode wfeditor (in previous ver. miwtools seems are OKAY with this): PS C:\Temp\RedmiWatch2SOFT\miwtool-main> python main.py --encode_wfeditor C:\Temp\RedmiWatch2SOFT!WacthFaces\output\ArcGTS_conv\ --output C:\Temp\RedmiWatch2SOFT!WacthFaces\input\gtspowder -ce little Traceback (most recent call last): File "main.py", line 75, in encoder.encode(output_file) File "C:\Temp\RedmiWatch2SOFT\miwtool-main\encoder\watch_face_encoder.py", line 30, in encode counter = self.encode_components() File "C:\Temp\RedmiWatch2SOFT\miwtool-main\encoder\watch_face_encoder.py", line 61, in encode_components self.component_encoders[-1].encode(counter) File "C:\Temp\RedmiWatch2SOFT\miwtool-main\encoder\component_encoder.py", line 35, in encode self.encoded_data[3] = self.encoded_property_3() File "C:\Temp\RedmiWatch2SOFT\miwtool-main\encoder\component_encoder.py", line 124, in encoded_property_3 self.encode_image(image) File "C:\Temp\RedmiWatch2SOFT\miwtool-main\encoder\component_encoder.py", line 149, in encode_image image_bytes, mask_bytes = ImageEncoder.encode_from_image(image, self.component.spacing) File "C:\Temp\RedmiWatch2SOFT\miwtool-main\image.py", line 86, in encode_from_image mask_array[y, x] = pixel[3] IndexError: index 3 is out of bounds for axis 0 with size 3

WF to encode: https://drive.google.com/file/d/1W3-mJCZJqQMpwY1qlG6h6M-6p1ZUSU6X/view?usp=share_link

Domenick90 commented 1 year ago

But --decode_wfeditor Instead of --encode_wfeditor and --encode after that works fine!

Mino260806 commented 1 year ago

Thanks. No need to elaborate more, I know how to fix it but I don't have time rn

Domenick90 commented 1 year ago

Well, in that case this problem is not critical, because there is a workaround.