View Single Post
  #5  
Old 09-29-2013, 11:49 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
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).
__________________
Reply With Quote