RameshAditya / asciify

Convert any image into ASCII Art.
1.14k stars 166 forks source link

ValueError: height and width must be > 0 #3

Closed repodevs closed 5 years ago

repodevs commented 6 years ago

Trying convert Image 7319167558_9ac77e8a54_b.jpg to ASCII get this error

$ python asciify.py 7319167558_9ac77e8a54_b.jpg
Traceback (most recent call last):
  File "asciify.py", line 86, in <module>
    runner(path)
  File "asciify.py", line 65, in runner
    image = do(image)
  File "asciify.py", line 40, in do
    image = resize(image)
  File "asciify.py", line 16, in resize
    new_image = image.resize(new_dim)
  File "/home/repodevs/.virtualenvs/asciify/local/lib/python2.7/site-packages/PIL/Image.py", line 1765, in resize
    return self._new(self.im.resize(size, resample, box))
ValueError: height and width must be > 0
RameshAditya commented 6 years ago

@repodevs Hm, that's odd. I tried running the script on the same picture and had no errors.

Here was my output -

https://imgur.com/CsVDW6F

I see that you're running it on Python 2.7, right?

I executed my script on Python 3.6.1.

I verified this by running python --version on the terminal. Perhaps, you should try executing the script on the same version.

JohnF8 commented 6 years ago

I had this same issue and I was using Python 2.7. When I ran with python 3 it worked.

davechen1 commented 5 years ago

image Hi why my img is so ugly and don't like yours?

RameshAditya commented 5 years ago

@davechen1 I'm unsure what you mean - your output matches my output from the GIF in the readme.

If you're referencing the text version of the image I've added below the GIF, I had to remove a few lines to fit the ascii-fied image into the screen so it may not look the same.

Your output is exactly the same as mine is supposed to be. :slightly_smiling_face: