Search code examples
google-apps-scriptgoogle-sites

Resizing image in Google Apps Script


I have an 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


Solution

  • 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.