Skip to content

Commit

Permalink
jimp
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbuechele committed Sep 10, 2024
1 parent 7665608 commit 03e1088
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@
"email-validator": "^2.0.4",
"env-var": "^7.5.0",
"form-data": "^4.0.0",
"googleapis": "^134.0.0",
"googleapis": "^144.0.0",
"graphile-worker": "0.16",
"graphql": "^16.9.0",
"graphql-scalars": "^1.23.0",
"graphql-yoga": "^5.7.0",
"hono": "^4.5.11",
"is-empty-obj": "^1.0.13",
"jimp": "^0.22.12",
"jimp": "^1.6.0",
"json-stable-stringify": "^1.1.1",
"jsonwebtoken": "^9.0.2",
"lodash.merge": "^4.6.2",
"markdown-to-txt": "^2.0.1",
"nodemailer": "^6.9.15",
"normalize-url": "6",
"normalize-url": "8",
"object-inspect": "^1.13.2",
"samlify": "^2.8.11",
"sax": "^1.4.1",
Expand Down
6 changes: 3 additions & 3 deletions src/routes/owntracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import env from '../utils/env';
import {createHash} from 'crypto';
import prismaClient from '../utils/prismaClient';
import {sub} from 'date-fns';
import jimp from 'jimp';
import {Jimp} from 'jimp';
import viewerIdFromToken from '../utils/viewerIdFromToken';
import {Hono} from 'hono';
import {ApiError} from '../utils/errorReporting';
Expand Down Expand Up @@ -387,8 +387,8 @@ async function faceBase64({profilePicture}: Viewer): Promise<string> {
if (!profilePicture) {
return '';
}
const jpg = await jimp.read(profilePicture);
const png = await jpg.resize(100, 100).getBufferAsync(jimp.MIME_PNG);
const jpg = await Jimp.read(profilePicture);
const png = await jpg.resize({w: 100, h: 100}).getBuffer('image/png');
return png.toString('base64');
}

Expand Down

0 comments on commit 03e1088

Please sign in to comment.