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

add setter for outputWidth and outputHeight or ability to control this.myCroppa.width and this.myCroppa.height directly before calling this.generateDataUrl to control output size #244

Open
corey-cosman opened this issue Oct 8, 2021 · 0 comments

Comments

@corey-cosman
Copy link

corey-cosman commented Oct 8, 2021

I want to be able to affect the output width and height without affecting that of the container.

The use case is: I want to be able to upload one image and then store three differently sized images on s3. The stored images will be small, med, and large. The initial-image prop will take the dimensions specified in the container, but I want to hard code the pixel width and height values for the small and large images. I am attempting this by setting the quality prop manually in the method that handles image upload. I am setting this right before I call generateDataUrl. This does not affect the files that are actually stored to s3 (they still take the quality specified in the prop itself). When i try to set this.myCroppa.outputWidth (or height), this also doesn't work because there is no setter on these properties.

When I try to set this.myCroppa.width and this.myCroppa.height manually, the conatiner size changes on the ui, and then when calling this.generateDataUrl and storing image in s3, the initial container's width and height props are stored, not the new values set in the upload handler. Has anyone done something like this with this package? Any help is greatly appreciated. Thanks

related issues:

#100
#213
#122

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

No branches or pull requests

1 participant