0
这part of the documentation是有关我想做的事,但它看起来硬编码:FineUploader.js如何有条件地重新缩放和压缩图像?
var uploader = new qq.FineUploader({
...
scaling: {
sizes: [
{name: "small", maxSize: 100},
{name: "medium", maxSize: 300}
]
}
});
我想缩放到有条件做的,尚未被用户压缩的图像。
这里是什么,我想完成一些伪代码:
if ((filesize < 1 megabytes) and (image.width*image.height > 1 megapixels)) {
Keep the original image without manipulating it in any way
} else {
Rescale image longest side to maximum of 1600 pixels
Compress the image to 60% quality
if (filesize still > 1mb) {
Keep compressing with more jpeg until it's under 800kb
}
}
我不知道,如果细上传者JPEG压缩functioniality内置(或如果它只是缩放),如果它不那么也许可以使用J-I-C。
如果这种有条件的重新缩放和压缩可以用fine-uploader来完成,应该怎么做?如果不是,我应该考虑哪些其他路径?
此外,请参阅此进行中的功能,该功能将成为Fine Uploader 5.10.1的一部分。它将允许您委派一个您选择的图像大小调整库。 https://github.com/FineUploader/fine-uploader/issues/1525 –
谢谢!这个功能是否只有优秀的上传者正在实现,或者让其他库如jquery-file-upload实现它? – dtgq
不知道,但其他上传库都没有积极开发或维护得很好。我怀疑提供这种灵活性的少数几家提供这种灵活性。 –