Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jpeg-autorotate

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jpeg-autorotate - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

test/samples/transformed/.gitkeep

2

package.json
{
"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 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc