Setting Initial zoom value
See original GitHub issueHow to set initial zoom value?.When I am selecting an image it is showing zoomed. I want to decrease the zoom value.I think initially it is set to max value. But, I want to set it to minimum value.How do I do that?
I have tried with setZoom
option. It didn’t work for me.Example I tried:
$uploadCrop = $('#upload-demo').croppie({
viewport: {
width: 200,
height: 200,
type: 'square'
},
boundary: {
width: 700,
height: 300
}
});
$uploadCrop.croppie 'setZoom', 0.5
Issue Analytics
- State:
- Created 8 years ago
- Comments:23 (6 by maintainers)
Top Results From Across the Web
Setting a Default Zoom Level - Oracle Help Center
Setting a Default Zoom Level · From the Smart View ribbon, select Options, and then select Member Options in the left panel. ·...
Read more >Adjusting zoom settings in Chrome browser
By default, Chrome sets the zoom level to 100%. To manually adjust the settings, use the Ctrl key and “+” or “-” combos...
Read more >D3.js Set initial zoom level - Stack Overflow
However, on the initial load, the zoom level is way too close. Is there a method of setting the initial zoom level to...
Read more >How to set the zoom level in Internet Explorer 9 - Microsoft Learn
If you want to set the default zoom level to 125%, type 125000, and then click OK. Close Registry Editor. Sign out Windows...
Read more >How to Set the Microsoft Edge Default Zoom Level for Websites
To set the zoom level on an individual site, click the Options menu (three dots) and then click the plus or minus buttons....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To be honest, I have no idea what you’re wanting to do, but I’m going to guess that you want to zoom all the way out of the image…
in croppie.js find the line
defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));
and replace it with
defaultInitialZoom = self.options.initialZoom ? self.options.initialZoom : Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));
Now you got a new option initialZoom which you can set to any zoom factor or 1 for no zoom. If you don’t pass this option, you will have the default behaviour (a little zoom at start).