Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Image details

Hey all, I'm looking for a way to get the dimensions of an image when a graphic object is added. I've got the function handler in place, but the width and height are seem to always be whatever the grid size is. I'm hoping for a way to get the original asset size. It looks like the imgsrc is a viable url. Is there any way for me to load or query that asset for dimensions?
1529030694
The Aaron
Pro
API Scripter
The API has no access to the image data, only an object that represents the image.  That object does not know anything about the size of the image.  Believe you me, if we had access to that, you'd see quite a few scripts making use of it. =D
1529031022
The Aaron
Pro
API Scripter
How we've handled this in the past is by having a lookup based on part of the URL that is unique into an object with the dimensions for the graphic.  That's limited to only images you're aware of obviously, but if you're targeting a particular set, it can be useful.
That's most unfortunate :( How about the name of the asset within my library? All I seem to be getting is the URL and the name field is empty. Really any data that I can input at the asset level would be great. Is Roll20 responsive to API change requests?  Getting some meta-data about the images would be hugely helpful. thanks
I'm looking to upload a huge trove of tiles, and I really don't want to have to manually record their asset ids individually... But I'm guessing no one else does either and if there were a better way I'd have seen someone doing it.
1529073780
The Aaron
Pro
API Scripter
Right. =/ Feel free to up vote this suggestion:&nbsp; <a href="https://app.roll20.net/forum/post/1749220/api-tags" rel="nofollow">https://app.roll20.net/forum/post/1749220/api-tags</a>...