Skip to content

Commit

Permalink
Merge branch 'AnnatarHe/main'
Browse files Browse the repository at this point in the history
* AnnatarHe/main:
  revert changes to schema.ts
  fix: fix incorrect cropped when width or height are omitted
  • Loading branch information
jasonraimondi committed May 24, 2024
2 parents e15ca39 + c92773e commit a576e5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/image_render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export class ImageRenderService implements ImageRenderInterface {
await page.goto(url, this.NAV_OPTIONS);
return await this.resize(
await page.screenshot({ fullPage: !!config.isFullPage }),
config.width ?? 1000,
config.height ?? 1000,
config.width ?? undefined,
config.height ?? undefined,
);
} finally {
await page.close();
Expand All @@ -76,7 +76,7 @@ export class ImageRenderService implements ImageRenderInterface {
}
}

private async resize(image: Buffer, width: number, height: number): Promise<Buffer> {
private async resize(image: Buffer, width?: number, height?: number): Promise<Buffer> {
return await sharp(image).resize(width, height).toBuffer();
}
}

0 comments on commit a576e5d

Please sign in to comment.