WebImageLoader – Processing Library
WebImageLoader is a Processing Library for asynchronously download images from the web.
When you use the regular loadImage() function, sometimes it ‘hangs’ while fetching an image from the web.
With the WebImageLoader library, you can use a timeout parameter, preventing your sketch to hang.
Download
Click HERE to download the latest version (03/19/2019).
Example
import com.cage.webimageloader.*; WebImageLoader loader; PImage img; String url = "http://cagewebdev.com/wp-content/uploads/2016/01/logocage120.png"; /************************************************************************** * * SETUP * **************************************************************************/ void setup() { size(400, 400); // CREATE INSTANCE loader = new WebImageLoader(this); // LOAD THE IMAGE (url, timeout in millis) img = loader.load(url, 5000); imageMode(CENTER); } // setup() /************************************************************************** * * DRAW * **************************************************************************/ void draw() { // DISPLAY THE IMAGE image(img, width>>1, height>>1); } // draw()