@fullstackunicorn/websites 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/modules/images.js +12 -8
  2. package/package.json +1 -1
package/modules/images.js CHANGED
@@ -97,6 +97,7 @@ class Images {
97
97
  }
98
98
 
99
99
  generate = async ({ file, asset }) => {
100
+
100
101
  const picture = await this.getPicture({ file, asset })
101
102
  const pictureData = await this.getPictureData({ picture })
102
103
 
@@ -117,17 +118,20 @@ class Images {
117
118
 
118
119
  const created = []
119
120
  for (const entry of Object.entries(this.widths)) {
120
- if (pictureData.x <= entry[1]) continue
121
121
 
122
- const buffer = await this.getBuffer({ picture, entry })
122
+ const key = entry[0]
123
+ const w = entry[1]
124
+
125
+ if (pictureData.x < w) continue
126
+
123
127
  const thumbPath = this.getPathThumbnail({ picture, entry })
124
128
 
125
- // thumbnail
126
- this.appendFile(result, entry[0], {
127
- path: thumbPath,
128
- file: buffer
129
- })
130
- created.push(entry[0])
129
+ let buffer
130
+ if (pictureData.x === w) buffer = originalBuffer
131
+ else buffer = await this.getBuffer({ picture, entry })
132
+
133
+ this.appendFile(result, key, { path: thumbPath, file: buffer })
134
+ created.push(key)
131
135
  }
132
136
 
133
137
  F3.logs('✅ Created: ', created.join(' '))
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.4",
2
+ "version": "1.0.5",
3
3
  "name": "@fullstackunicorn/websites",
4
4
  "author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
5
5
  "description": "A development utility for generating icons, favicons, thumbnails and all what is needed for websites",