Skip to content

Commit

Permalink
Merge pull request #200 from chrisreddington/bump-jimp
Browse files Browse the repository at this point in the history
Bump Jimp to v 1.6.0
  • Loading branch information
chrisreddington authored Dec 4, 2024
2 parents da8e98a + a868049 commit 97618f0
Show file tree
Hide file tree
Showing 3 changed files with 312 additions and 386 deletions.
5 changes: 2 additions & 3 deletions components/og-image/getOgImage.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Jimp } from "jimp";
const { createHash } = require('crypto')

var Jimp = require('jimp')

async function getOgImage({ title, user, type }) {
if (process.env.NODE_ENV === 'development') {
return 'og image will be generated in production'
}

const hash = createHash('md5').update(title).digest('hex')

Jimp.read(`public/images/og/templates/${type}.png`, (err, image) => {
Jimp.read(`public/images/og/templates/${type}.png`, (err, image) => {
if (err) throw err

Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dayjs": "^1.11.10",
"fathom-client": "^3.6.0",
"gray-matter": "^4.0.3",
"jimp": "^0.22.12",
"jimp": "^1.6.0",
"markdown-it": "^13.0.2",
"next": "^14.2.10",
"react": "18.2.0",
Expand Down
Loading

0 comments on commit 97618f0

Please sign in to comment.