阅读文档后,即使图像很小,我仍然没有找到如何调整图像大小的解决方案。但它正在处理大图像,但又一次它不适用于小图像。请在下面查看我的代码:
$(document).ready(function(){
$('#image-cropper').cropit({
'minZoom': 2,
'allowDragNDrop': false,
'smallImage': 'allow'
});
});
.cropit-preview{
background-color: #f8f8f8;
background-size: cover;
border: 5px solid #ccc;
border-radius: 3px;
margin-top: 7px;
width: 400px;
height: 400px;
display: inline-block;
}
<div id="image-cropper">
<div class="cropit-preview"></div>
<input type="range" class="cropit-image-zoom-input" />
<input type="file" class="cropit-image-input" />
<div class="select-image-btn">Select new image</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropit/0.5.1/jquery.cropit.min.js"></script>
示例图像