Skip to content

Commit

Permalink
fix: thumbhash portrait images
Browse files Browse the repository at this point in the history
  • Loading branch information
thisismana committed Aug 6, 2024
1 parent 97f367a commit f310cde
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/image-handler/src/image-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
StatusCodes,
} from './lib';
import { S3 } from '@aws-sdk/client-s3';
import { rgbaToThumbHash, thumbHashToDataURL } from './lib/thumbhash';
import { rgbaToThumbHash } from './lib/thumbhash';

export class ImageHandler {
private readonly LAMBDA_PAYLOAD_LIMIT = 6 * 1024 * 1024;
Expand Down Expand Up @@ -159,7 +159,7 @@ export class ImageHandler {
break;
}
case 'thumbhash': {
originalImage.resize(100, 100, { fit: 'inside' });
originalImage.resize({ width: 100, height: 100, fit: ImageFitTypes.INSIDE });
break;
}
default: {
Expand All @@ -180,8 +180,6 @@ export class ImageHandler {
*/
private async applyResize(originalImage: sharp.Sharp, edits: ImageEdits): Promise<void> {
if (edits.resize === undefined) {
edits.resize = {};
edits.resize.fit = ImageFitTypes.INSIDE;
return;
}
const resize = this.validateResizeInputs(edits.resize);
Expand Down

0 comments on commit f310cde

Please sign in to comment.