FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Bug Fixes, Implemented Suggestions
(Moderator: fry)
   loadImage and URLs
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: loadImage and URLs  (Read 232 times)
Glen Murphy

WWW Email
loadImage and URLs
« on: Jan 24th, 2003, 4:15am »

Not sure if this is a bug or feature, but loadImage can't read anything from URLs, (I am in application mode).
 
( This is as a result of testing my suggestion here: http://proce55ing.net/discourse/yabb/board_Proce55ing_Software__action_display_num_1039710310.html )
 
Error is:
Code:

Uncaught error fetching image:
java.lang.NullPointerException
 at sun.awt.image.URLImageSource.getConnection(Unknown Source)
 at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
 at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
 at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
 at sun.awt.image.ImageFetcher.run(Unknown Source)

 
example code used:
 
Code:

void setup() {
  size(700,61);
  }
 
void loop() {
  BImage d = loadImage("http://riot.com.au/i/title-bar.gif");
  for(int i = 0; i < 700*61; i++) {
    pixels[i] = d.pixels[i];
    }
  }
 
fry


WWW
Re: loadImage and URLs
« Reply #1 on: Jan 24th, 2003, 2:59pm »

nah, that'd be a bug, or at least an oversight..
 
because of java security issues (can only connect back to the site from which the applet came) i only ever focussed on getting images from within that same directory as the applet.. though url support would be useful too.  
 
it should be easy enough to add, i'll try and write the extra few lines to check for http:// and proceed accordingly.
 
fry


WWW
Re: loadImage and URLs
« Reply #2 on: Jan 26th, 2003, 9:07pm »

fixed in 0049. let me know if there are still problems.
 
Pages: 1 

« Previous topic | Next topic »