sam210723 / xrit-rx

📡 Receive images from weather satellite GEO-KOMPSAT-2A (GK-2A).
https://vksdr.com/xrit-rx
MIT License
97 stars 18 forks source link

Unexpected keyword argument 'width' #8

Closed zxmb closed 4 years ago

zxmb commented 4 years ago
/home/pi/xrit-rx/received/LRIT/20191229/FD/IMG_FD_142_IR105_20191229_235006.jpg
/home/pi/xrit-rx/received/LRIT/20191229/FD/IMG_FD_143_IR105_20191229_000006.jpg
-----------------------------------------

Processing /home/pi/xrit-rx/received/LRIT/20191229/FD/IMG_FD_001_IR105_20191229_001006...
Traceback (most recent call last):
  File "./enhance-ir.py", line 338, in <module>
    init()
  File "./enhance-ir.py", line 82, in init
    handle_input(args.INPUT)
  File "./enhance-ir.py", line 184, in handle_input
    process(input)
  File "./enhance-ir.py", line 241, in process
    draw.rectangle((p1, p2), outline=(0xFF, 0xFF, 0xFF), width=3)
TypeError: rectangle() got an unexpected keyword argument 'width'
sam210723 commented 4 years ago

Please update Pillow by running:

pip3 install --upgrade pillow
zxmb commented 4 years ago

Thanks @sam210723 Linux and Python are difficult for me. I tried different operating systems.

Windows 10:

python enhance-ir.py -t \received\LRIT

Traceback (most recent call last):
  File "enhance-ir.py", line 11, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Raspberry Pi:

pi@raspberrypi:~/xrit-rx/tools $ python ./enhance-ir.py
 ~/xrit-rx/received/LRIT/20191229/FD -t
Traceback (most recent call last):
  File "./enhance-ir.py", line 338, in <module>
    init()
  File "./enhance-ir.py", line 75, in init
    gen_luts()
  File "./enhance-ir.py", line 123, in gen_luts
    sclut.append(clut[idx])
TypeError: list indices must be integers, not float

pi@raspberrypi:~/xrit-rx/tools $ python3 ./enhance-ir.py -t
~/xrit-rx/received/LRIT/20191229/FD

Processing
/home/pi/xrit-rx/received/LRIT/20191229/FD/IMG_FD_001_IR105_20191229_001006...
Traceback (most recent call last):
  File "./enhance-ir.py", line 338, in <module>
    init()
  File "./enhance-ir.py", line 82, in init
    handle_input(args.INPUT)
  File "./enhance-ir.py", line 184, in handle_input
    process(input)
  File "./enhance-ir.py", line 244, in process
    fnt = ImageFont.truetype("arialbd.ttf", size=38)
  File "/home/pi/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line
640, in truetype
    return freetype(font)
  File "/home/pi/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line
637, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/home/pi/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line
186, in __init__
    font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
sam210723 commented 4 years ago

Windows 10: You are missing the numpy package. Install it using:

pip3 install numpy

Raspberry Pi: You are probably running the script using Python 2 rather than Python 3. Try using:

python3 enhance-ir.py ~/xrit-rx/received/LRIT/20191229/FD -t

rather than:

python enhance-ir.py ~/xrit-rx/received/LRIT/20191229/FD -t
zxmb commented 4 years ago

Windows 10 OK!

Thank you!