scaleTo doesn't work for images

Hi, I’m trying to scale 1080p images to preview, but they always return in full size.

I’ve tried changing the size as suggested here but it doesn’t work.

Render speed is crucial, so requesting a poster or thumbnail is not ideal.

Hi,
scaleTo only works when you use the built in resolutions and aspect ratios, i.e:

"resolution": "1080",
"scaleTo": "mobile"

If you are using a custom size, then scaleTo won’t have any effect.

Are you trying to do a screengrab of the video to use as a poster or thumbnail, or something else? There may be a different way to achieve what you want.

Hi Lucas, thank you!

No, I currently only need a small preview image of a 1080 image for an Ads building platform, so users can customize the look of their ad and make a quick render. I’m currently getting render requests done in around 7s (render itself is ~750ms + render and status requests) which is not ideal.
In my case, it would be great to have an endpoint that would return a preview or thumbnail image only, in one request.

Images should render in 1-2 seconds. There can also be a delay if we need to download assets from your location but second render the assets should be cached.

Here is an example creating an image, with a thumbnail preview (you do get the large version too but speed should be the same):

{
    "timeline": {
        "background": "#000000",
        "tracks": [
            {
                "clips": [
                    {
                        "asset": {
                            "type": "title",
                            "text": "Hello",
                            "style": "future",
                            "size": "x-small",
                            "position": "left",
                            "offset": {
                                "x": 0.3,
                                "y": 0.1
                            }
                        },
                        "start": 0,
                        "length": 1
                    },
                    {
                        "asset": {
                            "type": "title",
                            "text": "World",
                            "style": "future",
                            "size": "medium",
                            "position": "left",
                            "offset": {
                                "x": 0.3,
                                "y": -0.1
                            }
                        },
                        "start": 0,
                        "length": 1
                    }
                ]
            },
            {
                "clips": [
                    {
                        "asset": {
                            "type": "image",
                            "src": "https://shotstack-assets.s3-ap-southeast-2.amazonaws.com/images/earth.jpg"
                        },
                        "start": 0,
                        "length": 1,
                        "offset": {
                            "x": 0.4
                        }
                    }
                ]
            }
        ]
    },
    "output": {
        "format": "jpg",
        "size": {
            "width": 850,
            "height": 500
        },
        "thumbnail": {
            "capture": 0.04,
            "scale": 0.35
        }
    }
}

This renders in under 1 second.

Also are you using webhooks (Webhooks | Shotstack Documentation). That might be able to notify your app as soon as the images are ready and avoid polling delays.

Image rendering is fast, so it’s not an issue for me.
I’ve already tested your suggestion and found that "scaleTo": "mobile" is actually faster by 50-100ms than requesting a thumbnail.

I’m using webhooks, but not for this because it’s a PHP app. So AJAX request to backend, render and pooling requests to API and then response back to the user. It would be great to have JS SDK or at least public API keys so I can ping Shotstack API directly from JS.