Share feedback, ideas and get community help

Updated 3 months ago

Get image width for uploaded image

I have been trying to do this in javascript and set a variable but I can't get it to work (with chatGPT's help).

There should be an easy way to pass the url of the uploaded image and get the width dimension right?

I also need to do it to get the height dimension.
g
4 comments
And I just need to return the dimension so

return getWidthInPixels({{imageURL}})

And I just need an integer of the pixel width from the function.. Seems like it should be simple.
I was able to do this just by using the api for imgbb and uploading images there from the URL- Don't necessarily need to use their image storage and can set to delete soon after but this returns the image dimenstions among other things with the HTTP Request.
Not sure how to mark this solved- I guess it kind of is but I'd still like to know if there is an EASY way to do this with javascript...
Oh- I see how to change the post tag to solved- I'll wait though see if anyone can give me some other options/javascript magic!
Add a reply
Sign up and join the conversation on Discord