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] correct scaling #16

Merged
merged 1 commit into from
Oct 23, 2018
Merged

Conversation

rvalitov
Copy link
Contributor

Fixes #13
I added code to fix all the problems from there, except the last line about exporting in function toDataURL to formats other than jpeg. There are 2 reasons for that:

  • it's not a bug, but a feature
  • not all browsers may support export to formats other than jpeg and png. For example, Chrome even supports webp, see the docs.
  • the user (programmer) may not want to have an image in the original format. Usually when we upload an image we want to have it in a predefined format, usually jpeg. It does not matter what kind of image the user selects: it may be any format supported by the browser, but after uploading we will have always jpeg, i.e. auto conversion is performed. I think it's logical. Alternatively, we could add a new option that would define the output format in which the JS code saves the final image. But such option is beyond the current PR.

else{
//No rotation, just scale the image
This.scaleImage(img, completionCallback);
}
Copy link
Owner

Choose a reason for hiding this comment

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

The whitespacing here needs correcting

@rossturner rossturner merged commit 1591ff0 into rossturner:master Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A few potential fixes
2 participants