Skip to content

Commit

Permalink
fix auto-crop
Browse files Browse the repository at this point in the history
  • Loading branch information
nd0ut committed Mar 18, 2019
1 parent 36c9f4e commit 2f04c56
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tools/auto-crop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ const autoCrop = (store, settings, uc) => {
const {crop: cropSettings, multiple} = settings
const {image} = store.getState()

// auto-crop only in single mode with free crop disabled
if (multiple || cropSettings.some(c => !c.preferedSize)) {
// auto-crop only in single file mode
if (!cropSettings || !multiple) {
return
}

// if even one of crop option sets allow free crop,
// we don't need to crop automatically
if (cropSettings.some(c => !c.preferedSize)) {
return
}

Expand Down

0 comments on commit 2f04c56

Please sign in to comment.