-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(image-shrink): improve icc profile support #902
Conversation
38e11e0
to
8c9650c
Compare
src/utils/image-processor.js
Outdated
) | ||
} | ||
|
||
const stripIccProfile = function (file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should always return image, original or stripped file
function (reason) { | ||
return $.Deferred().reject(exif, reason) | ||
() => exif, | ||
() => $.Deferred().reject(exif) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed returning of reason
because it isn't used anywhere and it changes the number of arguments here
}) | ||
return op.then( | ||
() => iccProfile, | ||
() => $.Deferred().reject(iccProfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also no reason
.then((shouldSkip) => { | ||
if (shouldSkip) { | ||
df.reject('skipped') | ||
return $.Deferred().reject() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed code execution after main deferred resolve
} | ||
if (iccProfile?.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iccProfile
could be undefined
in case when getExif
was rejected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
WDGT-476