diff --git a/data/23/chains/cosmos/logo-150px.op.webp b/data/23/chains/cosmos/logo-150px.op.webp new file mode 100644 index 0000000..dac885d Binary files /dev/null and b/data/23/chains/cosmos/logo-150px.op.webp differ diff --git a/data/23/chains/cosmos/logo-300px.op.webp b/data/23/chains/cosmos/logo-300px.op.webp new file mode 100644 index 0000000..3382f59 Binary files /dev/null and b/data/23/chains/cosmos/logo-300px.op.webp differ diff --git a/data/23/chains/cosmos/logo-500px.op.webp b/data/23/chains/cosmos/logo-500px.op.webp new file mode 100644 index 0000000..4b7f9a5 Binary files /dev/null and b/data/23/chains/cosmos/logo-500px.op.webp differ diff --git a/data/23/chains/cosmos/logo.op.webp b/data/23/chains/cosmos/logo.op.webp new file mode 100644 index 0000000..05902cd Binary files /dev/null and b/data/23/chains/cosmos/logo.op.webp differ diff --git a/data/23/chains/ethereum/logo.op.webp b/data/23/chains/ethereum/logo.op.webp new file mode 100644 index 0000000..49986ba Binary files /dev/null and b/data/23/chains/ethereum/logo.op.webp differ diff --git a/data/23/chains/polkadot/logo-150px.op.webp b/data/23/chains/polkadot/logo-150px.op.webp new file mode 100644 index 0000000..3d1f31c Binary files /dev/null and b/data/23/chains/polkadot/logo-150px.op.webp differ diff --git a/data/23/chains/polkadot/logo-300px.op.webp b/data/23/chains/polkadot/logo-300px.op.webp new file mode 100644 index 0000000..adc7aa6 Binary files /dev/null and b/data/23/chains/polkadot/logo-300px.op.webp differ diff --git a/data/23/chains/polkadot/logo-500px.op.webp b/data/23/chains/polkadot/logo-500px.op.webp new file mode 100644 index 0000000..637cd7c Binary files /dev/null and b/data/23/chains/polkadot/logo-500px.op.webp differ diff --git a/data/23/chains/polkadot/logo.op.webp b/data/23/chains/polkadot/logo.op.webp new file mode 100644 index 0000000..c275837 Binary files /dev/null and b/data/23/chains/polkadot/logo.op.webp differ diff --git a/data/23/contributors/broadcastr/logo-150px.op.webp b/data/23/contributors/broadcastr/logo-150px.op.webp new file mode 100644 index 0000000..a413f84 Binary files /dev/null and b/data/23/contributors/broadcastr/logo-150px.op.webp differ diff --git a/data/23/contributors/broadcastr/logo-300px.op.webp b/data/23/contributors/broadcastr/logo-300px.op.webp new file mode 100644 index 0000000..ec38327 Binary files /dev/null and b/data/23/contributors/broadcastr/logo-300px.op.webp differ diff --git a/data/23/contributors/broadcastr/logo-500px.op.webp b/data/23/contributors/broadcastr/logo-500px.op.webp new file mode 100644 index 0000000..2075e13 Binary files /dev/null and b/data/23/contributors/broadcastr/logo-500px.op.webp differ diff --git a/data/23/contributors/broadcastr/logo.op.webp b/data/23/contributors/broadcastr/logo.op.webp new file mode 100644 index 0000000..9ed6c07 Binary files /dev/null and b/data/23/contributors/broadcastr/logo.op.webp differ diff --git a/data/23/contributors/factorydao/logo-150px.op.webp b/data/23/contributors/factorydao/logo-150px.op.webp new file mode 100644 index 0000000..349195e Binary files /dev/null and b/data/23/contributors/factorydao/logo-150px.op.webp differ diff --git a/data/23/contributors/factorydao/logo-300px.op.webp b/data/23/contributors/factorydao/logo-300px.op.webp new file mode 100644 index 0000000..84b5fce Binary files /dev/null and b/data/23/contributors/factorydao/logo-300px.op.webp differ diff --git a/data/23/contributors/factorydao/logo-500px.op.webp b/data/23/contributors/factorydao/logo-500px.op.webp new file mode 100644 index 0000000..5fcfd16 Binary files /dev/null and b/data/23/contributors/factorydao/logo-500px.op.webp differ diff --git a/data/23/contributors/factorydao/logo.op.webp b/data/23/contributors/factorydao/logo.op.webp new file mode 100644 index 0000000..6b27a7f Binary files /dev/null and b/data/23/contributors/factorydao/logo.op.webp differ diff --git a/data/23/contributors/streameth/logo-150px.op.webp b/data/23/contributors/streameth/logo-150px.op.webp new file mode 100644 index 0000000..249bc5e Binary files /dev/null and b/data/23/contributors/streameth/logo-150px.op.webp differ diff --git a/data/23/contributors/streameth/logo-300px.op.webp b/data/23/contributors/streameth/logo-300px.op.webp new file mode 100644 index 0000000..8861917 Binary files /dev/null and b/data/23/contributors/streameth/logo-300px.op.webp differ diff --git a/data/23/contributors/streameth/logo-500px.op.webp b/data/23/contributors/streameth/logo-500px.op.webp new file mode 100644 index 0000000..b2bd13d Binary files /dev/null and b/data/23/contributors/streameth/logo-500px.op.webp differ diff --git a/data/23/contributors/streameth/logo.op.webp b/data/23/contributors/streameth/logo.op.webp new file mode 100644 index 0000000..0f04352 Binary files /dev/null and b/data/23/contributors/streameth/logo.op.webp differ diff --git a/data/23/other-events/basslayerz/photo-150px.op.webp b/data/23/other-events/basslayerz/photo-150px.op.webp new file mode 100644 index 0000000..736c233 Binary files /dev/null and b/data/23/other-events/basslayerz/photo-150px.op.webp differ diff --git a/data/23/other-events/basslayerz/photo-300px.op.webp b/data/23/other-events/basslayerz/photo-300px.op.webp new file mode 100644 index 0000000..83a7a4e Binary files /dev/null and b/data/23/other-events/basslayerz/photo-300px.op.webp differ diff --git a/data/23/other-events/basslayerz/photo-500px.op.webp b/data/23/other-events/basslayerz/photo-500px.op.webp new file mode 100644 index 0000000..4e174af Binary files /dev/null and b/data/23/other-events/basslayerz/photo-500px.op.webp differ diff --git a/data/23/other-events/basslayerz/photo.op.webp b/data/23/other-events/basslayerz/photo.op.webp new file mode 100644 index 0000000..416a154 Binary files /dev/null and b/data/23/other-events/basslayerz/photo.op.webp differ diff --git a/data/23/other-events/i-hate-models/photo-150px.op.webp b/data/23/other-events/i-hate-models/photo-150px.op.webp new file mode 100644 index 0000000..9da3e9a Binary files /dev/null and b/data/23/other-events/i-hate-models/photo-150px.op.webp differ diff --git a/data/23/other-events/i-hate-models/photo-300px.op.webp b/data/23/other-events/i-hate-models/photo-300px.op.webp new file mode 100644 index 0000000..dbdd01f Binary files /dev/null and b/data/23/other-events/i-hate-models/photo-300px.op.webp differ diff --git a/data/23/other-events/i-hate-models/photo-500px.op.webp b/data/23/other-events/i-hate-models/photo-500px.op.webp new file mode 100644 index 0000000..d2f2442 Binary files /dev/null and b/data/23/other-events/i-hate-models/photo-500px.op.webp differ diff --git a/data/23/other-events/i-hate-models/photo.op.webp b/data/23/other-events/i-hate-models/photo.op.webp new file mode 100644 index 0000000..acff99b Binary files /dev/null and b/data/23/other-events/i-hate-models/photo.op.webp differ diff --git a/data/23/other-events/maker-faire/logo-150px.op.webp b/data/23/other-events/maker-faire/logo-150px.op.webp new file mode 100644 index 0000000..871c40d Binary files /dev/null and b/data/23/other-events/maker-faire/logo-150px.op.webp differ diff --git a/data/23/other-events/maker-faire/logo-300px.op.webp b/data/23/other-events/maker-faire/logo-300px.op.webp new file mode 100644 index 0000000..13e3bcd Binary files /dev/null and b/data/23/other-events/maker-faire/logo-300px.op.webp differ diff --git a/data/23/other-events/maker-faire/logo-500px.op.webp b/data/23/other-events/maker-faire/logo-500px.op.webp new file mode 100644 index 0000000..098983f Binary files /dev/null and b/data/23/other-events/maker-faire/logo-500px.op.webp differ diff --git a/data/23/other-events/maker-faire/logo.op.webp b/data/23/other-events/maker-faire/logo.op.webp new file mode 100644 index 0000000..1d815af Binary files /dev/null and b/data/23/other-events/maker-faire/logo.op.webp differ diff --git a/data/23/other-events/pq/logo-150px.op.webp b/data/23/other-events/pq/logo-150px.op.webp new file mode 100644 index 0000000..0503f2f Binary files /dev/null and b/data/23/other-events/pq/logo-150px.op.webp differ diff --git a/data/23/other-events/pq/logo-300px.op.webp b/data/23/other-events/pq/logo-300px.op.webp new file mode 100644 index 0000000..9f908c4 Binary files /dev/null and b/data/23/other-events/pq/logo-300px.op.webp differ diff --git a/data/23/other-events/pq/logo-500px.op.webp b/data/23/other-events/pq/logo-500px.op.webp new file mode 100644 index 0000000..c8cd0e0 Binary files /dev/null and b/data/23/other-events/pq/logo-500px.op.webp differ diff --git a/data/23/other-events/pq/logo.op.webp b/data/23/other-events/pq/logo.op.webp new file mode 100644 index 0000000..857be6e Binary files /dev/null and b/data/23/other-events/pq/logo.op.webp differ diff --git a/data/23/other-events/wax-tailor/photo-150px.op.webp b/data/23/other-events/wax-tailor/photo-150px.op.webp new file mode 100644 index 0000000..bb0124e Binary files /dev/null and b/data/23/other-events/wax-tailor/photo-150px.op.webp differ diff --git a/data/23/other-events/wax-tailor/photo-300px.op.webp b/data/23/other-events/wax-tailor/photo-300px.op.webp new file mode 100644 index 0000000..be33fe8 Binary files /dev/null and b/data/23/other-events/wax-tailor/photo-300px.op.webp differ diff --git a/data/23/other-events/wax-tailor/photo-500px.op.webp b/data/23/other-events/wax-tailor/photo-500px.op.webp new file mode 100644 index 0000000..b105bfb Binary files /dev/null and b/data/23/other-events/wax-tailor/photo-500px.op.webp differ diff --git a/data/23/other-events/wax-tailor/photo.op.webp b/data/23/other-events/wax-tailor/photo.op.webp new file mode 100644 index 0000000..2aff037 Binary files /dev/null and b/data/23/other-events/wax-tailor/photo.op.webp differ diff --git a/utils/engine.js b/utils/engine.js index c7536a8..41c92b0 100644 --- a/utils/engine.js +++ b/utils/engine.js @@ -298,10 +298,14 @@ class DeConf_Collection { if (!info) { return null; } - const longer = info.width > info.height ? 'w' : 'h' - const ratio = longer === 'h' ? (info.width / info.height) : (info.height / info.width); + const longer = info.width > info.height ? "w" : "h"; + const ratio = longer === "h" + ? (info.width / info.height) + : (info.height / info.width); for (const sz of thumbSizes) { - const pxs = longer === 'h' ? [ sz, Math.round(sz / ratio) ] : [ Math.round(sz / ratio), sz]; + const pxs = longer === "h" + ? [sz, Math.round(sz / ratio)] + : [Math.round(sz / ratio), sz]; //console.log(`size=${sz} px_orig=${[info.width, info.height]} px=${pxs}`) //console.log(info.width, info.height, ratio, sz, cheight) const szDest = [this.dir, fn.replace(/\.([^\.]+)$/, `-${sz}px.op.webp`)] @@ -363,26 +367,34 @@ class DeConf_Collection { const writeImage = async (fn, outDir, fnRename = null) => { const srcFile = [this.dir, fn].join("/"); if (await exists(srcFile)) { - const outFile = [ outDir, fnRename || posix.basename(fn) ].join("/"); + const outFile = [outDir, fnRename || posix.basename(fn)].join("/"); await _fileCopy(srcFile, outFile); } - } + }; const writeImageBundle = async (src, outDir) => { await ensureDir(outDir); //await writeImage(src, outDir) //await writeImage(src.replace(/\.(.+)$/, '.op.webp'), outDir, posix.basename(src).replace(/\.(.+)$/, `.webp`)) - await writeImage(src.replace(/\.(.+)$/, '-500px.op.webp'), outDir, posix.basename(src).replace(/\.(.+)$/, `.webp`)) + await writeImage( + src.replace(/\.(.+)$/, "-500px.op.webp"), + outDir, + posix.basename(src).replace(/\.(.+)$/, `.webp`), + ); for (const sz of thumbSizes) { - await writeImage(src.replace(/\.(.+)$/, `-${sz}px.op.webp`), outDir, posix.basename(src).replace(/\.(.+)$/, `_${sz}px.webp`)) + await writeImage( + src.replace(/\.(.+)$/, `-${sz}px.op.webp`), + outDir, + posix.basename(src).replace(/\.(.+)$/, `_${sz}px.webp`), + ); } - } + }; for (const asset of this.assets) { if (!x[asset]) continue; - const outDir = [outputDir, this.id].join("/") - await emptyDir(outDir) - await writeImageBundle(x[asset], outDir) - const fnOut = [this.id, x[asset].replace(/\.[^.]+$/, '.webp')].join("/"); + const outDir = [outputDir, this.id].join("/"); + await emptyDir(outDir); + await writeImageBundle(x[asset], outDir); + const fnOut = [this.id, x[asset].replace(/\.[^.]+$/, ".webp")].join("/"); const url = [publicUrl, fnOut].join("/"); this.data.index[asset] = url; } @@ -394,16 +406,16 @@ class DeConf_Collection { const outDir = [outputDir, this.id, "photos", "speakers"].join("/"); for (const sp of speakersCol) { if (!sp.photo) continue; - await writeImageBundle(sp.photo, outDir) + await writeImageBundle(sp.photo, outDir); sp.photoUrl = [ - publicUrl, - this.id, - "photos", - "speakers", - posix.basename(sp.photo).replace(/\.[^.]+$/, '.webp'), - ].join("/"); - } + publicUrl, + this.id, + "photos", + "speakers", + posix.basename(sp.photo).replace(/\.[^.]+$/, ".webp"), + ].join("/"); + } } } diff --git a/utils/imgs.js b/utils/imgs.js index 1e7e958..986955b 100644 --- a/utils/imgs.js +++ b/utils/imgs.js @@ -11,7 +11,7 @@ if (Deno.args[0]) { const ev = entry.data.events.find((e) => e.id === Deno.args[0]); await ev.optimizeImages(); } else { - for (const type of ["events", "places", "benefits", "media-partners"]) { + for (const type of Object.keys(entry.colMapper)) { for (const item of entry.data[type]) { if (item.data.index.hidden) { continue;