We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › uploading transparent images to a server...
Page Index Toggle Pages: 1
uploading transparent images to a server... (Read 426 times)
uploading transparent images to a server...
May 19th, 2009, 2:33pm
 
So, I want to make a custom doodle program (mostly for my own use, on a few of my tablet PCs)... ideally I would have a web page that would save the file on the server, and include transparency.

I started playing with postToWeb , but couldn't get the PHP working - nor my own Perl upload script I've relied on in the past... and my webhost isn't making it easy to see the error logs, but that's not a problem for this place. Besides, I suspect that if createGraphics.save()s are the main supported way of making transparent PNGs, then postToWeb probably isn't doing that anyway.

So, I dunno. Maybe a client application, save from a offscreen graphic, and one of the FTP libraries? Any other things alternatives I should consider?
Re: uploading transparent images to a server...
Reply #1 - May 19th, 2009, 11:17pm
 
I don't see why the transparency shouldn't be preserved.
Although I haven't tried, and don't have time right now.
But note that drawings on screen have no transparency. You have to draw on a PGraphics and pass it to the data upload method, instead of g.image:
bOK = du.UploadImage("snapshot." + currentFormat, (BufferedImage) someGraphics.image);
Again, not tested yet, will try later.

If you cannot run a PHP script on your host, you can perhaps use FTP, but not in an applet: remember than connection details will be in the .jar, so anybody could easily get access to your server by analyzing it.

Now, you should try and debug, perhaps you have no write access to the target folder or something.
You can also set up a server on your own computer and experiment from there, that's what I do first.
Page Index Toggle Pages: 1