Skip to content

Commit

Permalink
chore(e2e): skip normaliztion if required size already
Browse files Browse the repository at this point in the history
  • Loading branch information
fshovchko committed Sep 19, 2024
1 parent 1130eb4 commit 700909b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions e2e/setup/serializers/image-snapshot.sharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class SharpService {
height: number,
metadata: sharp.Metadata
): Promise<Buffer> => {
if (metadata.width === width && metadata.height === height) return image.toBuffer();

const padX = Math.max(0, (width - metadata.width!) / 2);
const padY = Math.max(0, (height - metadata.height!) / 2);

Expand Down

0 comments on commit 700909b

Please sign in to comment.