diff --git a/README.md b/README.md index 207c8b9..cb93b1d 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,13 @@ opts = { height: 100, width: 100 } opts = { quality: 80 } ``` +##### Preserve EXIF Data + +```js +// note: this will no longer auto-orient images according to its EXIF data +opts = { preserveExif: true } +``` + ##### Watermark You can overlay a transparent watermark over the final image: @@ -220,6 +227,12 @@ opts = { framerate: 60 } opts = { framerate: 0 } // preserve the original source video's FPS ``` +##### Preserve Metadata + +```js +opts = { preserveMetadata: true } +``` + ##### Conversion progress The `.video()` call returns an [EventEmitter](https://nodejs.org/api/events.html) diff --git a/lib/image/gmagick.js b/lib/image/gmagick.js index 7d2bf86..b349da3 100644 --- a/lib/image/gmagick.js +++ b/lib/image/gmagick.js @@ -6,8 +6,11 @@ exports.prepare = function (source, options) { // start processing with GraphicsMagick const image = gm(source) - // read baked-in orientation info, and output a rotated image with orientation=0 - image.autoOrient() + if (!options.preserveExif) { + // read baked-in orientation info, and output a rotated image with orientation=0 + // note: this strips EXIF data + image.autoOrient() + } // optional watermark const cropping = options.width && options.height diff --git a/lib/video/ffargs.js b/lib/video/ffargs.js index 93cbe8b..869768c 100644 --- a/lib/video/ffargs.js +++ b/lib/video/ffargs.js @@ -30,6 +30,10 @@ exports.prepare = function (source, target, options) { // misc options args.push('-vsync', '2', '-movflags', '+faststart') + if (options.preserveMetadata) { + args.push('-map_metadata', 0) + } + // audio bitrate args.push('-ab', DEFAULT_AUDIO_BITRATE)