nuno-faria / tiler

👷 Build images with images
MIT License
5.89k stars 423 forks source link

gen_tiles.py fails on certain images #17

Open patschreiber opened 5 years ago

patschreiber commented 5 years ago

Certain images seem to work, but most fail with a very similar message to the example below

All commands run from tiler's root directory (tiler/) Run command with .jpg version of image

python3 gen_tiles.py images/test2/test2.jpg

Output

  0%|                                                     | 0/5 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "gen_tiles.py", line 31, in <module>
    new_img = img * [b, g, r, 1]
ValueError: operands could not be broadcast together with shapes (1360,1000,3) (4,) 

Convert image to .png, run command again

python3 gen_tiles.py images/test2/test2.png

Output:

Traceback (most recent call last):
  File "gen_tiles.py", line 23, in <module>
    img = img.astype('float')
AttributeError: 'NoneType' object has no attribute 'astype'

System information:

nuno-faria commented 5 years ago

I fixed the problem for the .jpg images. Give that a try now.

As for the .png one, are you sure images/test2/test2.png exists and is a valid image? If so, could you send it?