This commit is contained in:
tree 2023-04-27 05:16:24 +02:00
rodič 54e162e001
revize 01f85db8a0
43 změnil soubory, kde provedl 33 přidání a 21 odebrání

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 3.4 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 8.1 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 15 KiB

binární
data/23/chains/cosmos/logo.op.webp Normal file

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 25 KiB

binární
data/23/chains/ethereum/logo.op.webp Normal file

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 44 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 3.4 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 6.8 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 12 KiB

binární
data/23/chains/polkadot/logo.op.webp Normal file

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 54 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 1.5 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 2.8 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 4.6 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 4.0 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 2.6 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 5.7 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 9.7 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 8.7 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 1.3 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 2.6 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 4.2 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 3.9 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 5.1 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 13 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 25 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 32 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 2.7 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 7.6 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 17 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 25 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 8.9 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 26 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 47 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 36 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 2.8 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 6.3 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 12 KiB

binární
data/23/other-events/pq/logo.op.webp Normal file

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 35 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 2.1 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 4.4 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 8.0 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 8.5 KiB

Zobrazit soubor

@ -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("/");
}
}
}

Zobrazit soubor

@ -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;