@travetto/image 2.0.0 → 2.1.0
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/package.json +2 -2
- package/src/util.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/image",
|
|
3
3
|
"displayName": "Image",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "Image support, resizing, and optimization",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"images",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"directory": "module/image"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/command": "^2.
|
|
27
|
+
"@travetto/command": "^2.1.0"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
package/src/util.ts
CHANGED
|
@@ -33,8 +33,8 @@ export class ImageUtil {
|
|
|
33
33
|
* Resize/conversion util
|
|
34
34
|
*/
|
|
35
35
|
static CONVERTER = new CommandService({
|
|
36
|
-
containerImage: '
|
|
37
|
-
localCheck: ['
|
|
36
|
+
containerImage: ' jameskyburz/graphicsmagick-alpine:v1.0.0',
|
|
37
|
+
localCheck: ['gm', ['-version']]
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -60,7 +60,7 @@ export class ImageUtil {
|
|
|
60
60
|
static resize(image: Buffer, options: ImageOptions): Promise<Buffer>;
|
|
61
61
|
static async resize(image: ImageType, options: ImageOptions): Promise<NodeJS.ReadableStream | Buffer> {
|
|
62
62
|
const state = await this.CONVERTER.exec(
|
|
63
|
-
'convert', '-resize', `${options.w ?? ''}x${options.h ?? ''}`,
|
|
63
|
+
'gm', 'convert', '-resize', `${options.w ?? ''}x${options.h ?? ''}`,
|
|
64
64
|
'-auto-orient',
|
|
65
65
|
...(options.optimize ? ['-strip', '-quality', '86'] : []),
|
|
66
66
|
'-', '-');
|