I'm new to Processing. I'm trying to use the Post to web library and having issues. I'm using the supplied example:
Quote:import processing.pdf.*;
import org.seltar.Bytes2Web.*;
PDFToWeb pdf;
void setup()
{
size(800,600);
pdf = new PDFToWeb(this);
}
void draw()
{
background(0);
stroke(255);
line(random(width),random(height),random(width),random(height));
pdf.addPage(); // if you want each frame to be on it's own page
}
void keyPressed()
{
String url = "http://itsshameful.com/";
if(key == 'p'){
if(!pdf.isRecording()){
pdf.startRecording();
}else{
pdf.save("pdf");
pdf.post("test",url,"pdf-test",true);
}
}
if(key == 'j'){
ImageToWeb img = new ImageToWeb(this);
img.save("jpg",true);
img.post("test",url,"jpg-test",true,img.getBytes(g));
}
if(key == 't'){
ImageToWeb img = new ImageToWeb(this);
img.setType(ImageToWeb.TIFF);
img.save("tiff",true);
img.post("test",url,"tiff-test",true);
}
if(key == 'n'){
ImageToWeb img = new ImageToWeb(this);
img.setType(ImageToWeb.PNG);
img.save("png",true);
img.post("test",url,"png-test",true);
}
if(key == 'g'){
ImageToWeb img = new ImageToWeb(this);
img.setType(ImageToWeb.GIF);
img.save("gif",true);
img.post("test",url,"gif-test",true);
}
}
itsshameful.com is a live site with only two things in the root directory..a folder named saved and the file Upload.php as per the instructions. the folder "saved" is 777. I'm getting these errors:
KEY PRESSED....P
Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: processing/pdf/PGraphicsPDF
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at processing.core.PApplet.makeGraphics(Unknown Source)
at processing.core.PApplet.createGraphics(Unknown Source)
at org.seltar.Bytes2Web.PDFToWeb.startRecording(PDFToWeb.java:26)
at example_1.keyPressed(example_1.java:47)
at processing.core.PApplet.handleKeyEvent(Unknown Source)
at processing.core.PApplet.dequeueKeyEvents(Unknown Source)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: processing.pdf.PGraphicsPDF
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 21 more
KEY PRESSED.....J
java.io.FileNotFoundException: http://itsshameful.com/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311)
at org.seltar.Bytes2Web.PostToWeb._post(PostToWeb.java:108)
at org.seltar.Bytes2Web.ImageToWeb.post(ImageToWeb.java:73)
at example_1.keyPressed(example_1.java:56)
at processing.core.PApplet.handleKeyEvent(Unknown Source)
at processing.core.PApplet.dequeueKeyEvents(Unknown Source)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
java.io.FileNotFoundException: http://itsshameful.com/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311)
at org.seltar.Bytes2Web.