I believe your goal is as follows.
- You want to retrieve the TIFF and BMP image files and put them to the Google Slides.
Unfortunately, in the current stage, these image files cannot be directly put to the Google Slides. In this case, it is required to convert them to another format that can be put to the Google Slides. In this answer, I would like to introduce this method.
Sample script:
This script uses Drive API. So when you use this script, please enable Drive API at Advanced Google services.
var imageID = "###" // Please set the file ID of the image file.
var imageUrl = Drive.Files.get(imageID).thumbnailLink.replace(/\=s\d+/, "=s1000");
var presentation = SlidesApp.openById(slideID);
presentation.getSlides()[0].insertImage(imageUrl);
and also, you can use the following script.
var imageID = "###" // Please set the file ID of the image file.
var imageUrl = Drive.Files.get(imageID).thumbnailLink.replace(/\=s\d+/, "=s1000");
var image = UrlFetchApp.fetch(imageUrl).getBlob();
var presentation = SlidesApp.openById(slideID);
presentation.getSlides()[0].insertImage(image);
- When
thumbnailLink
is used by modifying the query parameter, the images of various mimeTypes can be converted to PNG format. This method uses this situation.
Reference: