IO-2008 Include mime type for listed media.

This commit is contained in:
Patrick Fic
2022-08-03 13:27:17 -07:00
parent 3d0791f633
commit 92e7e3ebda
4 changed files with 41 additions and 6 deletions

View File

@@ -71,8 +71,9 @@ async function GeneratePdfThumbnail(file: string, thumbPath: string) {
const fileOnDisk: Buffer = await fs.readFile(file);
return new Promise<string>((resolve, reject) => {
const result = gm(fileOnDisk)
.selectFrame(0)
.setFormat("png")
.resize(200) // Resize to fixed 200px width, maintaining aspect ratio
.resize(200, 200, "!") // Resize to fixed 200px width, maintaining aspect ratio
.quality(75)
.write(thumbPath, (error) => {
if (error) reject(error.message);