mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:01:08 +02:00
🐛 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:
parent
08c90d57f0
commit
b29a0190ed
1 changed files with 5 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue