在Google Apps脚本中调整图像大小 [英] Resizing image in Google Apps Script

查看:80
本文介绍了在Google Apps脚本中调整图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张图片,我想调整它的大小.

I have an image and I want to resize this.

应用脚本代码:

var fileId = 'idImage';
var img = DriveApp.getFileById(fileId).getBlob().;
newFile.getBody().insertImage(0, img); 

对象Blob无法调整大小,那么如何调整图像大小?

Object Blob can't resize so how can I resize my image?

致谢

推荐答案

就像FYI一样,您不需要调用getBlob().任何具有getBlob()的东西都可以直接传递到Blob所在的位置需要.

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 Apps脚本中调整图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆