Skip to content

Commit

Permalink
Merge pull request #71 from kltchnko/dev
Browse files Browse the repository at this point in the history
Fix #70: options object being altered by compress func
  • Loading branch information
Donaldcwl authored Nov 8, 2020
2 parents 30e2b1c + d830728 commit 2096484
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/browser-image-compression.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/browser-image-compression.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/browser-image-compression.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/browser-image-compression.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/image-compression.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export default async function compress (file, options) {
incProgress()

// exifOrientation
options.exifOrientation = options.exifOrientation || await getExifOrientation(file)
const exifOrientation = options.exifOrientation || await getExifOrientation(file)
incProgress()
const orientationFixedCanvas = (await isAutoOrientationInBrowser) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, options.exifOrientation)
const orientationFixedCanvas = (await isAutoOrientationInBrowser) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation)
incProgress()

let quality = options.initialQuality || 1.0
Expand Down

0 comments on commit 2096484

Please sign in to comment.