diff --git a/src/server/routes/rest/file/image.ts b/src/server/routes/rest/file/image.ts index dffe15d..8666a94 100644 --- a/src/server/routes/rest/file/image.ts +++ b/src/server/routes/rest/file/image.ts @@ -69,7 +69,7 @@ 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); + return path.join(document, recordId, fieldName, 'thumbnail', fileName).replace(/\.jpeg$/, '') + '.jpeg'; } if (preprocess != null) { return path.join(document, recordId, fieldName, 'watermark', fileName); diff --git a/src/server/routes/rest/file/sendFile.ts b/src/server/routes/rest/file/sendFile.ts index 5d6a48e..cb42183 100644 --- a/src/server/routes/rest/file/sendFile.ts +++ b/src/server/routes/rest/file/sendFile.ts @@ -80,7 +80,7 @@ export async function sendFile(filePath: string, reply: FastifyReply) { Bucket: MetaObject.Namespace.storage.bucket, Key: filePath, }, - result: s3Result, + result: s3Result.$metadata, }, `Proxying file ${filePath} from S3`, ); diff --git a/src/server/routes/rest/file/upload.ts b/src/server/routes/rest/file/upload.ts index 22e97d6..75273ee 100644 --- a/src/server/routes/rest/file/upload.ts +++ b/src/server/routes/rest/file/upload.ts @@ -133,7 +133,7 @@ const fileUploadApi: FastifyPluginCallback = (fastify, _, done) => { .resize({ width: MetaObject.Namespace.storage?.thumbnail?.size ?? DEFAULT_THUMBNAIL_SIZE, height: MetaObject.Namespace.storage?.thumbnail?.size ?? DEFAULT_THUMBNAIL_SIZE, - fit: 'inside', + fit: 'cover', }) .jpeg({ quality: MetaObject.Namespace.storage?.jpeg?.quality ?? DEFAULT_JPEG_QUALITY,