HOME

  • ABOUT
  • PORTFOLIO
  • NEWS, TECH & ART
    • Websites
    • WordPress Plugins
    • Processing.org
    • Neural networks
    • New Media Art
  • RASPBERRY PI
  • ABOUT
  • PORTFOLIO
  • NEWS, TECH & ART
    • Websites
    • WordPress Plugins
    • Processing.org
    • Neural networks
    • New Media Art
  • RASPBERRY PI
WebImageLoader – Processing Library
webimageloader

WebImageLoader – Processing Library

  • async, asynchronously, image loader, library, loadimage, processing, processing library, processing.org

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()

 

Donations

Please support the development of my Processing libraries!




previous article
profile background
profile image

Rolf van Gelder

Owner of CAGE Web Design

CAGE was established in the year 2000

What’s new?

  • WebImageLoader – Processing Library
  • Responsive P5JS for WP – WordPress plugin
  • Optimize Database after Deleting Revisions – WordPress plugin
© 1995-2023 CAGE Web Design, Eindhoven, NL | +31 (0)6 22 66 3193