@browserless/screenshot 10.5.1 → 10.5.3

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.
package/README.md CHANGED
@@ -24,4 +24,4 @@ Authored and maintained by [Microlink](https://microlink.io) with help from [con
24
24
 
25
25
  The [logo](https://thenounproject.com/term/browser/288309/) has been designed by [xinh studio](https://xinh.studio).
26
26
 
27
- > [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)
27
+ > [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/screenshot",
3
3
  "description": "Take a clean screenshot of any website",
4
4
  "homepage": "https://browserless.js.org/#/?id=screenshoturl-options",
5
- "version": "10.5.1",
5
+ "version": "10.5.3",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -28,13 +28,13 @@
28
28
  "screenshot"
29
29
  ],
30
30
  "dependencies": {
31
- "@browserless/goto": "^10.5.0",
31
+ "@browserless/goto": "^10.5.2",
32
32
  "@kikobeats/time-span": "~1.0.3",
33
33
  "debug-logfmt": "~1.2.1",
34
34
  "got": "~11.8.6",
35
35
  "is-html-content": "~1.0.0",
36
36
  "is-url-http": "~2.3.7",
37
- "jimp": "~0.22.10",
37
+ "jimp": "~1.1.2",
38
38
  "map-values-deep": "~1.0.2",
39
39
  "mime": "~3.0.0",
40
40
  "p-reflect": "~2.1.0",
@@ -44,7 +44,7 @@
44
44
  "svg-gradient": "~1.0.3"
45
45
  },
46
46
  "devDependencies": {
47
- "@browserless/test": "^10.3.0",
47
+ "@browserless/test": "^10.5.2",
48
48
  "ava": "5",
49
49
  "cheerio": "latest"
50
50
  },
@@ -65,5 +65,5 @@
65
65
  "timeout": "2m",
66
66
  "workerThreads": false
67
67
  },
68
- "gitHead": "6b77276b078d55ad706d47cbc5f18b885a145f22"
68
+ "gitHead": "e1ca16c0a84a7b4618b9ef05c9aba966cb16b1f5"
69
69
  }
@@ -1,12 +1,12 @@
1
1
  'use strict'
2
2
 
3
- const jimp = require('jimp')
3
+ const { Jimp } = require('jimp')
4
4
 
5
- module.exports = async buffer => {
6
- const image = await jimp.read(buffer)
5
+ module.exports = async uint8array => {
6
+ const image = await Jimp.fromBuffer(Buffer.from(uint8array))
7
7
  const firstPixel = image.getPixelColor(0, 0)
8
- const height = image.getHeight()
9
- const width = image.getWidth()
8
+ const height = image.bitmap.height
9
+ const width = image.bitmap.width
10
10
 
11
11
  const samplePercentage = 0.25 // Sample 25% of the image
12
12
  const sampleSize = Math.floor(width * height * samplePercentage) // Calculate sample size based on percentage