-
Notifications
You must be signed in to change notification settings - Fork 884
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
Scale down the viewport? #253
Comments
I've a similar problem. I'm using croppie to create a banner of 653x250px and is working just fine. But since I'm using it on a responsive site, I've the problem with mobile version with a width of 320px. It's friday evening and still thinking about me, please forgive me if I'm completely wrong ;) |
I am looking to do exactly the same thing +1 |
I got as far as this:
This is most likely what is needed, css transform does the trick, the issue is that the scale_factor needs to be taken into account when the cropping occurs, I took a look at croppie code and it looks like there is no way to pass an arbitrary scale.. |
I tried a different thing: on croppie init I set viewport & boundary to the container size:
BTW I'm using angular but it's exactly the same with jQuery.
So the idea is to use the container size for the viewport and then ask to export the image in original size. All the scaling is handled by croppie. Didn't change a single line of code :) |
Seems like you guys got it figured out. If there's something you'd like to see in croppie, feel free to comment again, but for cleanliness purposes, I'm closing this one. |
I need help. Could anybody explain me about "ctrl" in the topic "optimalab commented on Dec 3, 2016 • edited" ??? |
Can somebody give us a clean code about this? |
You can export a higher resolution (than the viewport) by just setting the size, a'la: const croppedBlob = await myCroppie.result({
type: 'blob',
size: {height: 500, width: 500},
format: 'png',
}); |
I added to aviewport new parameter 'sale' like this viewport:{width: 235, height: 235, type: 'square',scale:1} And added bunch of changes to croppie.js like on screenshot https://yadi.sk/i/wwp7-FArWRzgsA
|
Hi, I'm planning to use Croppie to allow users to upload a pretty big banner (roughly 1900x900). If I set the viewport to the size above, it'll display the widget in real size. Is there a way to scale down the interface so it knows that the image is 1900x900, but show it scaled down?
Thanks.
The text was updated successfully, but these errors were encountered: