@fullstackunicorn/websites 2.0.0 → 2.1.0
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.
- package/modules/images.js +8 -3
- package/package.json +1 -1
- package/package.md +3 -3
package/modules/images.js
CHANGED
|
@@ -3,13 +3,17 @@ import { path, sharp, blurhash } from '#@/index.dep.js'
|
|
|
3
3
|
class Images {
|
|
4
4
|
extensions = ['.jpg', '.png']
|
|
5
5
|
recipe = 'webp-lossless-sml-v1'
|
|
6
|
+
sizesVersion = 1
|
|
6
7
|
widths = {
|
|
7
8
|
S1: 64,
|
|
8
9
|
S2: 128,
|
|
9
10
|
S3: 256,
|
|
10
11
|
M1: 320,
|
|
11
|
-
M2:
|
|
12
|
-
M3:
|
|
12
|
+
M2: 400,
|
|
13
|
+
M3: 480,
|
|
14
|
+
M4: 640,
|
|
15
|
+
M5: 800,
|
|
16
|
+
M6: 960,
|
|
13
17
|
L1: 1280,
|
|
14
18
|
L2: 1920,
|
|
15
19
|
L3: 2560
|
|
@@ -67,6 +71,7 @@ class Images {
|
|
|
67
71
|
pictureData.src = picture.src
|
|
68
72
|
pictureData.ratio = size.width / size.height
|
|
69
73
|
pictureData.max = this.getMaxSize({ size })
|
|
74
|
+
pictureData.sizesVersion = this.sizesVersion
|
|
70
75
|
pictureData.full = path.posix.join(picture.folder, picture.dir, `${picture.name}.webp`)
|
|
71
76
|
pictureData.widths = Object.fromEntries(Object.entries(this.widths).filter(([, width]) => width <= size.width))
|
|
72
77
|
|
|
@@ -151,4 +156,4 @@ class Images {
|
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
158
|
|
|
154
|
-
export const images = new Images()
|
|
159
|
+
export const images = new Images()
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.1.0",
|
|
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",
|
package/package.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @fullstackunicorn/websites
|
|
2
2
|
|
|
3
|
-
Versione sorgente: `1.0
|
|
3
|
+
Versione sorgente: `2.1.0`. Installazione: `npm install @fullstackunicorn/websites` (registro/permessi del pacchetto richiesti).
|
|
4
4
|
|
|
5
5
|
Utility Node per generare immagini e icone con sharp.
|
|
6
6
|
|
|
@@ -14,11 +14,11 @@ import { websites } from '@fullstackunicorn/websites'
|
|
|
14
14
|
| websites.images.getPicture({ file, folder }) | file.path/file.buffer e destinazione → elaborazione immagine e metadati |
|
|
15
15
|
|
|
16
16
|
## Formati
|
|
17
|
-
Icone: favicon 32, icone 180/192/512. Immagini: jpg/jpeg/png; larghezze S1 64, S2 128, S3 256, M1 320, M2
|
|
17
|
+
Icone: favicon 32, icone 180/192/512. Immagini: jpg/jpeg/png; media sizes version 1 con larghezze S1 64, S2 128, S3 256, M1 320, M2 400, M3 480, M4 640, M5 800, M6 960, L1 1280, L2 1920, L3 2560. Estensione non supportata: errore. Helper interni non sono un contratto stabile separato.
|
|
18
18
|
|
|
19
19
|
## Requisiti e limiti
|
|
20
20
|
Node con dipendenze native sharp; non importare nel bundle browser. L’entrypoint carica initialize e modifica F3.service nel codice legacy. Verificare file reali e output prima di adozione; nessun nuovo collaudo implicito in questa documentazione.
|
|
21
21
|
|
|
22
22
|
## Images 2.0
|
|
23
23
|
|
|
24
|
-
Original bytes are preserved. Full-resolution and resized display files use lossless WebP, preserving alpha. Each derivative is resized from the source with Sharp (no enlargement). Metadata contains `src` with `/S1/` as a reference template, `full` for the full-resolution WebP, `widths` for available variants, `x`, `y`, `ratio`, `max` (null below 64px), and `placeholder`. Resolve the selected variant before issuing a request. `S1` is not an intermediate download. The image recipe identifier
|
|
24
|
+
Original bytes are preserved. Full-resolution and resized display files use lossless WebP, preserving alpha. Each derivative is resized from the source with Sharp (no enlargement). Metadata contains `sizesVersion: 1`, `src` with `/S1/` as a reference template, `full` for the full-resolution WebP, `widths` for available variants, `x`, `y`, `ratio`, `max` (null below 64px), and `placeholder`. Resolve the selected variant before issuing a request. `S1` is not an intermediate download. The image recipe identifier and the sizes version together identify processing caches.
|