I am evaluating Google Sheets with AppScripts for a report generator. The requirements include inserting images from Google Drive. One of the input image has a fix format, which I need to crop. ( So the dimensions of the original image and the dimensions of the crop is known.)
I am looking for a solution to achieve this outcome, but I am struggling. I looked into the following methods:
- No image crop function in the Drive API
- No image crop ( only resize) for the Sheets OverGridImage object
- No image crop for the
=IMAGE()function - Manually you can create a drawing, add an image and crop it:
- But you can't do this from AppScripts
- You can't access the image within the drawing as an OverGridImage object. ( Which would allow you to replace it's image.)
- You can use the Slides API
replace(imageUrl, crop)- Is it possible to embed/link the slide into the sheet via AppScript?
Is there any other workaround? ( Even if it means creating a new file in drive?)
EDIT: Obviously there is the solution to call an external API, or to use GCP services such as CloudFunctions ( which are not free). However I am hoping for an AppScript solution. ( Or using a compatible JS library.)