Skip to content

Commit b005c44

Browse files
authored
Merge pull request #602 from HashLips/dev
Community improvements
2 parents 304fcfc + cfabbee commit b005c44

5 files changed

Lines changed: 64 additions & 8 deletions

File tree

.github/bug_report.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug Report
3+
about: Report that something isn't working.
4+
labels: bug
5+
---
6+
7+
## Description
8+
9+
<!-- Describe the issue that you're seeing. -->
10+
11+
### Steps to reproduce
12+
13+
<!-- Clear steps describing how to reproduce the issue. -->
14+
15+
### Expected result
16+
17+
<!-- What should happen? -->
18+
19+
### Actual result
20+
21+
<!-- What happened? -->
22+
23+
### Environment
24+
25+
- OS Version:
26+
- Node.js version:

.github/feature_request.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new idea for the project.
4+
labels: enhancement
5+
---
6+
7+
## Summary
8+
9+
<!-- Brief explanation of the feature. -->
10+
11+
### Basic example
12+
13+
<!-- Include a basic code example. Omit this section if it's not applicable. -->
14+
15+
### Motivation
16+
17+
<!-- Why are we doing this? What use cases does it support? What is the expected outcome? -->

src/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const addMetadata = (_dna, _edition) => {
146146
description: tempMetadata.description,
147147
//Added metadata for solana
148148
seller_fee_basis_points: solanaMetadata.seller_fee_basis_points,
149-
image: `image.png`,
149+
image: `${_edition}.png`,
150150
//Added metadata for solana
151151
external_url: solanaMetadata.external_url,
152152
edition: _edition,
@@ -155,7 +155,7 @@ const addMetadata = (_dna, _edition) => {
155155
properties: {
156156
files: [
157157
{
158-
uri: "image.png",
158+
uri: `${_edition}.png`,
159159
type: "image/png",
160160
},
161161
],
@@ -177,6 +177,9 @@ const addAttributes = (_element) => {
177177
};
178178

179179
const loadLayerImg = async (_layer) => {
180+
if (_layer.selectedElement.path.includes("-")) {
181+
throw new Error("layer name can not contain dashes");
182+
}
180183
return new Promise(async (resolve) => {
181184
const image = await loadImage(`${_layer.selectedElement.path}`);
182185
resolve({ layer: _layer, loadedImage: image });

utils/generate_metadata.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@ const getImages = (_dir) => {
4444
};
4545

4646
const loadImgData = async (_imgObject) => {
47-
return new Promise(async (resolve) => {
47+
try {
4848
const image = await loadImage(`${_imgObject.path}`);
49-
resolve({ imgObject: _imgObject, loadedImage: image });
50-
});
49+
return {
50+
imgObject: _imgObject,
51+
loadedImage: image,
52+
};
53+
} catch (error) {
54+
console.error("Error loading image:", error);
55+
}
5156
};
5257

5358
const draw = (_imgObject) => {

utils/pixelate.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ const getImages = (_dir) => {
3838
};
3939

4040
const loadImgData = async (_imgObject) => {
41-
return new Promise(async (resolve) => {
41+
try {
4242
const image = await loadImage(`${_imgObject.path}`);
43-
resolve({ imgObject: _imgObject, loadedImage: image });
44-
});
43+
return {
44+
imgObject: _imgObject,
45+
loadedImage: image,
46+
};
47+
} catch (error) {
48+
console.error("Error loading image:", error);
49+
}
4550
};
4651

4752
const draw = (_imgObject) => {

0 commit comments

Comments
 (0)