如何在Google应用脚本上调整图片大小 [英] How to resize image on Google app Script
本文介绍了如何在Google应用脚本上调整图片大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
应用程序脚本代码:
var fileId ='idImage';
var img = DriveApp.getFileById(fileId).getBlob()。
newFile.getBody()。insertImage(0,img);
对象Blob无法调整大小,因此我如何调整图片大小?
问候
解决方案
正如一个供参考,不这样做需要调用getBlob()..任何有getBlob()的东西都可以在需要Blob的地方直接传入。
I have a image and I want to resize this.
App Script code :
var fileId = 'idImage';
var img = DriveApp.getFileById(fileId).getBlob().;
newFile.getBody().insertImage(0, img);
Object Blob can't resize so , how Can i Resize my image ?
Regards
解决方案
Just as an FYI, you don't need to call getBlob().. anything that has a getBlob() can be passed in directly wherever a Blob is needed.
这篇关于如何在Google应用脚本上调整图片大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文