Skip to content

Commit

Permalink
BC-4975 - Only resize image if original width is bigger than target w…
Browse files Browse the repository at this point in the history
…idth (#4398)
  • Loading branch information
bischofmax authored Sep 11, 2023
1 parent b5e4628 commit 6fb3f65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe('PreviewService', () => {

await previewService.getPreview(fileRecord, downloadParams, previewParams);

expect(resizeMock).toHaveBeenCalledWith(previewParams.width);
expect(resizeMock).toHaveBeenCalledWith(previewParams.width, undefined, '>');
expect(resizeMock).toHaveBeenCalledTimes(1);
});

Expand Down Expand Up @@ -521,7 +521,7 @@ describe('PreviewService', () => {

await previewService.getPreview(fileRecord, downloadParams, previewParams);

expect(resizeMock).toHaveBeenCalledWith(previewParams.width);
expect(resizeMock).toHaveBeenCalledWith(previewParams.width, undefined, '>');
expect(resizeMock).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class PreviewService {
const { width } = previewParams;

if (width) {
preview.resize(width);
preview.resize(width, undefined, '>');
}

const result = preview.stream(format);
Expand Down

0 comments on commit 6fb3f65

Please sign in to comment.