OUDON / rmqrcode-python

Rectangular Micro QR Code (rMQR Code) Generator in Python
https://pypi.org/project/rmqrcode/
Other
158 stars 16 forks source link

unknown file extension: .png #46

Closed PixelSymbols closed 1 year ago

PixelSymbols commented 1 year ago

with space:

C:\Users\SYM\Pictures>rmqr 'github.com/PixelSymbols' 'github profile.png'
usage: rmqr [-h] [--ecc {M,H}] [--version VERSION] [--fit-strategy {min_width,min_height,balanced}] DATA OUTPUT
rmqr: error: unrecognized arguments: profile.png'

Without space

C:\Users\SYM\Pictures>rmqr 'github.com/PixelSymbols' 'github_profile.png'
Traceback (most recent call last):
  File "C:\Users\SYM\AppData\Local\Programs\Python\Python312\Lib\site-packages\PIL\Image.py", line 2415, in save
    format = EXTENSION[ext]
             ~~~~~~~~~^^^^^
KeyError: ".png'"

The above exception was the direct cause of the following exception:

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:\Users\SYM\AppData\Local\Programs\Python\Python312\Scripts\rmqr.exe\__main__.py", line 7, in <module>
  File "C:\Users\SYM\AppData\Local\Programs\Python\Python312\Lib\site-packages\rmqrcode\console.py", line 61, in main
    _save_image(qr, args.OUTPUT)
  File "C:\Users\SYM\AppData\Local\Programs\Python\Python312\Lib\site-packages\rmqrcode\console.py", line 36, in _save_image
    image.save(output)
  File "C:\Users\SYM\AppData\Local\Programs\Python\Python312\Lib\site-packages\rmqrcode\qr_image.py", line 24, in save
    self._img.save(name)
  File "C:\Users\SYM\AppData\Local\Programs\Python\Python312\Lib\site-packages\PIL\Image.py", line 2418, in save
    raise ValueError(msg) from e
ValueError: unknown file extension: .png'
OUDON commented 1 year ago

Thank you for the issue. Please try this.

rmqr "github.com/PixelSymbols" "github_profile.png"
PixelSymbols commented 1 year ago

Yep, works now! Awesome Thx for fix, and for adding support for spaces!

OUDON commented 1 year ago

Thank you for letting me know. I'll update the README. Thanks.