🐛 fix(figgos): resolve storage key to URL before downloading fusion parent images

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Chr1st1anG 2026-02-13 00:01:03 +01:00
parent 08c90d57f0
commit b29a0190ed

View file

@ -207,9 +207,11 @@ export class GenerationService {
}
}
private async downloadAndConvertImage(imageUrl: string): Promise<Buffer> {
const res = await fetch(imageUrl);
if (!res.ok) throw new Error(`Failed to download image: ${res.status}`);
private async downloadAndConvertImage(imageKey: string): Promise<Buffer> {
const url = this.storageService.getPublicUrl(imageKey);
this.logger.log(`Downloading image: ${url}`);
const res = await fetch(url);
if (!res.ok) throw new Error(`Failed to download image: ${res.status} from ${url}`);
const webpBuffer = Buffer.from(await res.arrayBuffer());
return sharp(webpBuffer).jpeg({ quality: 85 }).toBuffer();
}