NotLuksus / nft-art-generator

A tool to generate generative NFT art projects.
MIT License
1.62k stars 532 forks source link

crashes when attribute values are not identical #8

Closed paOol closed 3 years ago

paOol commented 3 years ago

crashes when not all "how many __ should there be?" values are not all the same.

for example;

how many should there be? 9 how many should there be? 5

will result in crashing after generating a few images.

also unrelated, but I don't see the config.js file even with the [--save-config] flag

/usr/local/lib/node_modules/nft-art-generator/node_modules/merge-images/dist/index.umd.js:39
            img.onerror = function () { return reject(new Error('Couldn\'t load image')); };
                                                      ^

Error: Couldn't load image
    at img.onerror (/usr/local/lib/node_modules/nft-art-generator/node_modules/merge-images/dist/index.umd.js:39:46)
    at setSource (/usr/local/lib/node_modules/nft-art-generator/node_modules/canvas/lib/image.js:91:13)
    at Image.set (/usr/local/lib/node_modules/nft-art-generator/node_modules/canvas/lib/image.js:62:9)
    at /usr/local/lib/node_modules/nft-art-generator/node_modules/merge-images/dist/index.umd.js:41:12
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/nft-art-generator/node_modules/merge-images/dist/index.umd.js:30:55
    at Array.map (<anonymous>)
    at /usr/local/lib/node_modules/nft-art-generator/node_modules/merge-images/dist/index.umd.js:30:24
    at new Promise (<anonymous>)
    at mergeImages (/usr/local/lib/node_modules/nft-art-generator/node_modules/merge-images/dist/index.umd.js:22:10)
NotLuksus commented 3 years ago

The config file is still only on Github and not on the package, so if you want that you need to build the package from the Github source. To your issues, that is something that makes sense. if you want to generate 10 images in total and these images consist of 2 layers then you would need 10 of both layers. I imagine that you want some of the layers to be empty. To achieve that you would need to add an empty png file to the folder.

You can also check out this video I made: https://www.youtube.com/watch?v=ThLoQTh0QUQ&t=2s

I hope that help!