Get image dimensions from backend workflow

Hello community!

I hope you’re all doing well. I’m currently working on a new integration and need some assistance. I’m trying to retrieve the dimensions (width and height) of images received via a webhook.

While I’ve successfully achieved this on the frontend with custom code, I’m facing challenges implementing it in the backend workflow. The goal is to place a marker on the image based on the x and y pixel values I receive. However, since the image dimensions vary, I can’t establish a universal rule.

I came across a plugin named “Image Dimensions,” but unfortunately, it’s only available on the frontend, which doesn’t suit my needs. Has anyone here encountered a similar situation and successfully tackled it, perhaps using the Toolbox Server Script plugin?

Any guidance or insights would be highly appreciated! :pray:

in the API connector create a GET with https://bubble.imgix.net/[url]

that will return the pixel h & w of the image URL you pass to it.

of course can be called as an action from the backend.

4 Likes

@Bubbleboy

Pretty darn cool. Bookmarked. :smiley:

Thank you!

1 Like

Hey @Bubbleboy thanks for your fats answer!

This way look amazing for me! I tried but cannot get the height and width in the call return:

"returned_an_error": false,
    "headers": {
        "connection": "keep-alive",
        "content-length": "5975",
        "last-modified": "Tue, 21 Nov 2023 17:36:07 GMT",
        "cache-control": "public, max-age=2592000",
        "server": "imgix",
        "x-imgix-id": "b8761970a4d655eb20730e86ba6cc26955bb6f6d",
        "x-imgix-render-farm": "01.140328",
        "date": "Tue, 21 Nov 2023 17:39:44 GMT",
        "age": "217",
        "accept-ranges": "bytes",
        "content-type": "image/jpeg",
        "access-control-allow-origin": "*",
        "timing-allow-origin": "*",
        "cross-origin-resource-policy": "cross-origin",
        "x-content-type-options": "nosniff",
        "x-served-by": "cache-sjc10030-SJC, cache-fra-etou8220040-FRA",
        "x-cache": "MISS, HIT"
    }
}

And don’t seems also to be in the body. What did I miss here?
My API connector setup:

no! you’ve got the datatype as image, change that to JSON
you’ll get this

1 Like

also you are missing passing the JSOn parameter

you call should look like this

1 Like

You’re the boss @Bubbleboy :pray:

Thanks a lot!

This topic was automatically closed after 70 days. New replies are no longer allowed.