Skip to content

Commit

Permalink
fix: image thumbnail path
Browse files Browse the repository at this point in the history
  • Loading branch information
7sete7 committed Jul 18, 2024
1 parent 16f3723 commit a9d19eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/routes/rest/file/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ async function imageApiFn(
const getImagePath = () => {
const maxDimension = Math.max(parseInt(width, 10), parseInt(height, 10));
if (maxDimension <= thumbnailSize) {
return path.join(document, recordId, fieldName, 'thumbnail', fileName).replace(/\.jpeg$/, '') + '.jpeg';
const filePath = path.join(document, recordId, fieldName, 'thumbnail', fileName);
return /\.jpe?g$/.test(fileName) ? filePath : `${filePath}.jpeg`;
}
if (preprocess != null) {
return path.join(document, recordId, fieldName, 'watermark', fileName);
Expand Down

0 comments on commit a9d19eb

Please sign in to comment.