Skip to content
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

Merged
merged 9 commits into from
Apr 4, 2022
Merged

Conversation

nd0ut
Copy link
Member

@nd0ut nd0ut commented Feb 9, 2022

WDGT-476

@nd0ut nd0ut requested a review from homm February 10, 2022 19:09
@nd0ut nd0ut removed the request for review from homm February 11, 2022 11:13
src/utils/image-processor.js Outdated Show resolved Hide resolved
src/utils/image-processor.js Outdated Show resolved Hide resolved
@nd0ut nd0ut requested a review from homm February 14, 2022 10:38
)
}

const stripIccProfile = function (file) {
Copy link
Contributor

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

src/utils/image-processor.js Outdated Show resolved Hide resolved
function (reason) {
return $.Deferred().reject(exif, reason)
() => exif,
() => $.Deferred().reject(exif)
Copy link
Member Author

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)
Copy link
Member Author

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()
Copy link
Member Author

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) {
Copy link
Member Author

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

@nd0ut nd0ut requested a review from homm March 28, 2022 14:52
Copy link
Contributor

@homm homm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

@nd0ut nd0ut merged commit 806734e into master Apr 4, 2022
@nd0ut nd0ut deleted the fix/shrink-keep-icc branch April 4, 2022 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants