Use ImageMagick instead of GraphicsMagick

This commit is contained in:
syuilo
2017-12-09 22:35:26 +09:00
parent c420901c24
commit 37edacce44
5 changed files with 14 additions and 5 deletions

View File

@@ -7,11 +7,15 @@ import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as cors from 'cors';
import * as mongodb from 'mongodb';
import * as gm from 'gm';
import * as _gm from 'gm';
import * as stream from 'stream';
import DriveFile, { getGridFSBucket } from '../api/models/drive-file';
const gm = _gm.subClass({
imageMagick: true
});
/**
* Init app
*/
@@ -78,6 +82,7 @@ function thumbnail(data: stream.Readable, type: string, resize: number): ISend {
const stream = g
.compress('jpeg')
.quality(80)
.noProfile() // Remove EXIF
.stream();
return {