penrose 0.2.29 → 0.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/penrose.js +4 -4
  2. package/package.json +8 -10
package/lib/penrose.js CHANGED
@@ -10,7 +10,6 @@ const pkg = require('../package.json');
10
10
  const Promise = require('bluebird');
11
11
  const replaceExt = require('replace-ext');
12
12
  const sharp = require('sharp');
13
- const svg2png = require('svg2png');
14
13
 
15
14
  /**
16
15
  * Constants
@@ -298,11 +297,12 @@ Penrose.prototype = {
298
297
  const $svg = cheerio.load(result.svg)('svg');
299
298
  const width = Math.ceil(exToPx($svg.attr('width'), config.ex));
300
299
  const height = Math.ceil(exToPx($svg.attr('height'), config.ex));
301
-
302
- return svg2png(buffer, {
300
+ const resize = {
303
301
  width: width,
304
302
  height: height
305
- });
303
+ };
304
+
305
+ return sharp(buffer).resize(resize).toBuffer();
306
306
  })
307
307
  .then((buffer) =>
308
308
  Promise.resolve('data:image/png;base64,' + buffer.toString('base64'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "penrose",
3
- "version": "0.2.29",
3
+ "version": "0.2.32",
4
4
  "description": "Build derivative images",
5
5
  "main": "lib/penrose.js",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "url": "https://github.com/netbek/penrose/issues"
21
21
  },
22
22
  "dependencies": {
23
- "@babel/core": "7.18.2",
23
+ "@babel/core": "7.18.5",
24
24
  "babel-eslint": "10.1.0",
25
25
  "babel-loader": "8.2.5",
26
26
  "babel-plugin-lodash": "3.3.4",
@@ -29,18 +29,18 @@
29
29
  "canonical-json": "0.0.4",
30
30
  "chalk": "4.1.2",
31
31
  "cheerio": "0.22.0",
32
- "eslint": "8.16.0",
32
+ "eslint": "8.18.0",
33
33
  "eslint-config-airbnb": "19.0.4",
34
34
  "eslint-config-prettier": "8.5.0",
35
35
  "eslint-plugin-babel": "5.3.1",
36
36
  "eslint-plugin-dollar-sign": "1.0.2",
37
37
  "eslint-plugin-html": "6.2.0",
38
38
  "eslint-plugin-import": "2.26.0",
39
- "eslint-plugin-jsdoc": "39.3.2",
40
- "eslint-plugin-jsx-a11y": "6.5.1",
39
+ "eslint-plugin-jsdoc": "39.3.3",
40
+ "eslint-plugin-jsx-a11y": "6.6.0",
41
41
  "eslint-plugin-markdown": "2.2.1",
42
42
  "eslint-plugin-prettier": "4.0.0",
43
- "eslint-plugin-react": "7.30.0",
43
+ "eslint-plugin-react": "7.30.1",
44
44
  "fs-extra": "10.1.0",
45
45
  "glob": "7.2.3",
46
46
  "glob-promise": "4.2.2",
@@ -49,11 +49,9 @@
49
49
  "mathjax": "2.7.9",
50
50
  "mathjax-node": "0.5.2",
51
51
  "phantomjs-prebuilt": "2.1.16",
52
- "prettier": "2.6.2",
52
+ "prettier": "2.7.1",
53
53
  "replace-ext": "2.0.0",
54
- "sharp": "0.30.5",
55
- "svg2png": "4.1.1",
56
- "webpack": "4.46.0"
54
+ "sharp": "0.30.7"
57
55
  },
58
56
  "devDependencies": {
59
57
  "chai": "4.3.6",