Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9628

How to insert a webp image into a document?

$
0
0

I am trying to insert a webp format image into a table in a document - however it's giving me an error. When I try with a jpg file, I am able to insert the image at the top of the file (I don't know how to insert inside the table - I have {image1} text in the position where I want to insert the image.)

My code is, which works fine:

  var product_image = UrlFetchApp.fetch("https://laz-img-cdn.alicdn.com/images/ims-web/TB1HKyxaMFY.1VjSZFqXXadbXXa.png").getBlob();  body.replaceText('{image1}', "img");  body.insertImage(0, product_image);

But when I change the URL to a webp image, it gives mean an invalid data error. For examples this code:

  var product_image = UrlFetchApp.fetch("https://my-test-11.slatic.net/original/ed9960ec66acc822e34fdeac570211e0.jpg_340x340q80.jpg_.webp").getBlob();

Viewing all articles
Browse latest Browse all 9628

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>