nuno-faria / tiler

👷 Build images with images
MIT License
5.91k stars 424 forks source link

AttributeError: 'NoneType' object has no attribute 'shape' #33

Closed KoderKumar closed 4 years ago

KoderKumar commented 4 years ago

This is the error python tiler.py ./images/logo.png ./tiles/minecraft Loading tiles 99%|████████████████████████████████▊| 150/151 [00:52<00:00, 2.96it/s]Traceback (most recent call last): File "tiler.py", line 223, in main() File "tiler.py", line 216, in main tiles = load_tiles(tiles_paths) File "tiler.py", line 85, in load_tiles tile = read_image(os.path.join(path, tile_name)) File "tiler.py", line 34, in read_image if img.shape[2] == 3: AttributeError: 'NoneType' object has no attribute 'shape' 99%|████████████████████████████████▊| 150/151 [00:52<00:00, 2.85it/s]

nuno-faria commented 4 years ago

Does the folder ./tiles/minecraft contain only images?

KoderKumar commented 4 years ago

yes

nuno-faria commented 4 years ago

Add this line to the function read_image (line 33): print(path) and check the file where it fails.

KoderKumar commented 4 years ago

It is giving me this error: File "C:\Users\VVA\Videos\ForYoutube\Python\MinecraftArt\tiler\tiler.py", line 224, in <module> main() File "C:\Users\VVA\Videos\ForYoutube\Python\MinecraftArt\tiler\tiler.py", line 207, in main tiles_paths = conf.TILES_FOLDER.split(' ') AttributeError: 'NoneType' object has no attribute 'split'

KoderKumar commented 4 years ago

are you going to help?

nuno-faria commented 4 years ago

You didn't pass the tiles folder as argument. You either have to run python tiler.py <image_to_tile> <folder_with_tiles> or set those variables in the conf.py file.

KoderKumar commented 4 years ago

i passed

nuno-faria commented 4 years ago

The program only uses the tiles folder from the conf.pyfile if there isn't enough arguments:

    if len(sys.argv) > 2:
        tiles_paths = sys.argv[2:]
    else:
        tiles_paths = conf.TILES_FOLDER.split(' ')

Show me the exact command you entered.

KoderKumar commented 4 years ago

I was passing 3 arugments

KoderKumar commented 4 years ago

and conf.py was corrupted, So i reinstall the package