Quote:
Originally Posted by Jakov_the_Jakovasaur
wouldnt getimgwidth(imagename) return 0 if the image file hasn't been downloaded yet?
or are you ensuring the image is pre-loaded?
|
Test it, but in the past, yes, it would return zero (but it would also trigger the downloading of the image, so you could keep trying it until it worked). If the image is not going to be changing much, you might as well just hardcode it as a constant in the script. Otherwise you'll have to wait for it to download (or if it's really important, you can force it to be pre-downloaded, e.g. via update packages or a script that triggers the download of certain images on login).