Search code examples
javascriptnode.jsgoogle-slides-api

What is the max image size when using createImage in Google Slides API?


When using Google Slides API to create a slide and then create an image within that slide I am getting an error

Invalid requests[19].createImage: The provided image is too large.

The size of the image in the provided url is 4.9MB. On wikipedia page about Google Slides it states that Images inserted cannot be larger than 50 MB, yet my image is 10 times smaller.

I have tried creating the presentation manually on the Google Slides, and importing the image via url, and that way it works.

I can't find the maximum size limit anywhere in the documentation.


Solution

  • Based on Google Slides API Documentation,

    createImage is a CreateImageRequest object. Under CreateImageRequest, it specifically states the following:

    • Images must be less than 50MB in size
    • Cannot exceed 25 megapixels
    • Must be in one of PNG, JPEG, or GIF format.
    • The provided URL can be at most 2 kB in length (url length should be maximum of 2000 characters).

    sample image