jpeg-autorotate
Advanced tools
Comparing version 4.0.0 to 4.0.1
{ | ||
"name": "jpeg-autorotate", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Rotates JPEG images based on EXIF orientation", | ||
@@ -5,0 +5,0 @@ "author": "Johan Satgé", |
@@ -162,2 +162,3 @@ ![Version](https://img.shields.io/npm/v/jpeg-autorotate.svg) | ||
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `4.0.1` | 2018-11-29 | Fix rotations `5` and `7` (issue #11) | | ||
| `4.0.0` | 2018-07-15 | Drop support for Node 4 & 5<br>Unpublish lockfile<br>Use prettier for code formatting<br>Update documentation<br>Update dependencies | | ||
@@ -164,0 +165,0 @@ | `3.1.0` | 2017-12-03 | Output dimensions after rotation (@tayler) | |
@@ -38,10 +38,13 @@ 'use strict' | ||
} | ||
const ratioWillChange = (transformations[orientation].rotate / 90) % 2 === 1 | ||
const destWidth = ratioWillChange ? jpeg.height : jpeg.width | ||
const destHeight = ratioWillChange ? jpeg.width : jpeg.height | ||
if (transformations[orientation].flip) { | ||
new_buffer = _flip(new_buffer, jpeg.width, jpeg.height) | ||
new_buffer = _flip(new_buffer, destWidth, destHeight) | ||
} | ||
const width = orientation < 5 ? jpeg.width : jpeg.height | ||
const height = orientation < 5 ? jpeg.height : jpeg.width | ||
const new_jpeg = jpegjs.encode({data: new_buffer, width: width, height: height}, quality) | ||
module_callback(null, new_jpeg.data, width, height) | ||
const new_jpeg = jpegjs.encode({data: new_buffer, width: destWidth, height: destHeight}, quality) | ||
module_callback(null, new_jpeg.data, destWidth, destHeight) | ||
} | ||
@@ -48,0 +51,0 @@ |
@@ -135,2 +135,5 @@ 'use strict' | ||
} | ||
if (typeof path_or_buffer === 'string') { | ||
fs.writeFileSync(path_or_buffer.replace('samples/', 'samples/transformed/'), buffer) | ||
} | ||
done() | ||
@@ -137,0 +140,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3157917
25
515
192
1