Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue (Missing "properties" / "files" in metadata generated with hashlips) #1

Open
Kalkz opened this issue Aug 16, 2022 · 6 comments
Open

Comments

@Kalkz
Copy link

Kalkz commented Aug 16, 2022

hello, when i run node app.js im getting this error

TypeError: Cannot read properties of undefined (reading 'files')
at main (C:\hashlips-animated-gif-collection-addon-main\app.js:64:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

@tapistefan
Copy link
Owner

Seems like your original metadata doesn't have "files" defined under "properties". Can you send me an example of your metadata?

@Kalkz
Copy link
Author

Kalkz commented Aug 17, 2022

hello, thank you very much for replying, here's an example of the metadata generated by hashlips
https://github.com/Kalkz/metadatatest/blob/main/test

also is it possible to generate more than 1 gif layer ? as an example "background" AND "Face"

@ballingaround
Copy link

Just found out about this tool, great work bud, i'm very new to coding i also tried to generate more than 1 gif layer by adding these lines in the config.js

module.exports = {
trait: "Guns",
background: false, // If set to "false" a replacement trait will be put in front of everything.
resolutionWidth: 1500, // must match resolution that you used when generating art with haslips art engine
resolutionHeight: 1500,
debug: false,
}

module.exports = {
trait: "Background",
background: false, // If set to "false" a replacement trait will be put in front of everything.
resolutionWidth: 1500, // must match resolution that you used when generating art with haslips art engine
resolutionHeight: 1500,
debug: false,

}

but ofc it doesn't work haha i'd love to know how

@tapistefan
Copy link
Owner

tapistefan commented Aug 22, 2022

hello, thank you very much for replying, here's an example of the metadata generated by hashlips https://github.com/Kalkz/metadatatest/blob/main/test

also is it possible to generate more than 1 gif layer ? as an example "background" AND "Face"

Hey sorry for the late response I was on vacation.
As I thought before you are missing a whole "properties" key from JSON that should look something like this:

"properties": {
    "files": [
      {
        "uri": "0.png",
        "type": "image/png"
      }
    ],
    "category": "image",
    "creators": [
      {
        "address": "SOLANAADDY",
        "share": 100
      }
    ]
  }

Maybe hashlips updated the metadata output and now it does not have that "properties" by default. Try using some older hashlips version.

Another workaround that should work in your case is just delete or comment out this 2 lines of code from the "app.js"

parsedJSON.properties.files[0].uri = `${parsedJSON.edition}.gif`
parsedJSON.properties.files[0].type = "image/gif"

@tapistefan
Copy link
Owner

Just found out about this tool, great work bud, i'm very new to coding i also tried to generate more than 1 gif layer by adding these lines in the config.js

module.exports = { trait: "Guns", background: false, // If set to "false" a replacement trait will be put in front of everything. resolutionWidth: 1500, // must match resolution that you used when generating art with haslips art engine resolutionHeight: 1500, debug: false, }

module.exports = { trait: "Background", background: false, // If set to "false" a replacement trait will be put in front of everything. resolutionWidth: 1500, // must match resolution that you used when generating art with haslips art engine resolutionHeight: 1500, debug: false,

}

but ofc it doesn't work haha i'd love to know how

Hey! Thanks a lot for the feedback! This kind of comments is what motivate me to build more tools and share them with the world :D
Nice to hear you started coding, just keep building and you will advance very fast.

As for the code you are right, you cant do multiple layers in one run, but easy workaround would be just running the script multiple times for different attributes.

@tapistefan tapistefan changed the title issue issue (Missing properties / files in metadata generated with hashlips) Aug 22, 2022
@tapistefan tapistefan changed the title issue (Missing properties / files in metadata generated with hashlips) issue (Missing "properties" / "files" in metadata generated with hashlips) Aug 22, 2022
@MDerramus
Copy link

ya no funciona porque se cambio la salida de propiedades a atributos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants