thumbnailer: fix exact sizing creating background

Use `-background none` to prevent
This commit is contained in:
2 * r + 2 * t 2025-04-06 19:50:31 +10:00
parent ded52a0f1d
commit c0f7b06729

View file

@ -34,7 +34,9 @@ export default class Thumbnailer {
try { try {
const width = this.getOpt("width", opts); const width = this.getOpt("width", opts);
const height = this.getOpt("height", opts); const height = this.getOpt("height", opts);
const cropCmd = this.getOpt("exact", opts) ? `-gravity Center -extent ${width}x${height}` : ""; const cropCmd = this.getOpt("exact", opts)
? `-background none -gravity center -extent ${width}x${height}`
: "";
await execAsync(`magick ${path} -thumbnail ${width}x${height}^ ${cropCmd} -unsharp 0x.5 ${thumbPath}`); await execAsync(`magick ${path} -thumbnail ${width}x${height}^ ${cropCmd} -unsharp 0x.5 ${thumbPath}`);
} catch { } catch {
if (attempts >= config.maxAttempts.get()) { if (attempts >= config.maxAttempts.get()) {