Hi all, I've been working on an image upload module for awhile now and I was wondering if there would be interest in it.

What I wanted was a module that let me 1) choose many files at a time on my local machine, 2) scale and rotate the images on my local machine, and then 3) upload the scaled,rotated image directly to an image gallery, and 4) store the images in gallery-specific directories on the server.

So basically it gives you similar functionality to using Gallery2 integration, but with actual drupal image nodes instead. Very useful for uploading lots of pictures from your digital camera quickly and without lots of fuss.

I have a screencast of the thing on youtube, it is here:

http://www.youtube.com/watch?v=2XOgrAE0EqQ

Comments

-Anti-’s picture

Did you say in the screen cast that it uses 'an applet'? Java? ActiveX? As in, something that could compress a 3mb photo down to 200kb using the power of the local machine, rather than having to upload 3mb per photo and then have apache on a shared server struggle to do all the compression and resizing work?

If that's what you're saying, I'd expect there would be about twenty thousand drupal users who'd use that.

It is a real pain explaining to users who use facebook and photobucket how they can upload photos straight from their camera to those million dollar sites, but before attempting to upload photos to our own site they first have to use irfanview to optimise them.

Also, are you thinking about submitting this as an official module on drupal.org?
Or is it just something you want users to download from your own site?

Whatever, thanks for sharing! It looks really good.

pre911mindset’s picture

Yes it is a Java applet. Javascript can't do anything on the local machine except choose a single file, as you know. Java does the work, and yes it is a huge timesaver. But there are some caveats.

Because the applet has full access to the local machine it must be trusted. Therefore it must be signed. There is no 'open source' signing authority therefore I have created a 'fake' certificate. So the first time you use it you will be asked to download this untrusted certificate. if you want to recompile java source and use the corresponding source you must create a keystore and sign the applet yourself. It is not difficult but probably most people have not done it. Of course you could also get a real verisign cert for it but that will cost $. You can also use my jar file which I will include with the module.

Second, since the applet cannot talk to the browser for security reasons it performs the upload directly to the server. It does this by 'faking' a form POST and sending a drupal form response to the server. This creates a little bit of a security risk, I try to work around it by passing the formid as an applet parameter and verifying that the formid and the user's cookie match up before committing the upload. IMO this is not a big deal but some people will say that it is.

Yes it is a module and I will share it once I figure out how to upload it to drupal site. It would be nice if some ajax/ahah guru could gussy it up a bit so that the applet/browser interaction is more seamless.

Thanks for the encouragement.

-Anti-’s picture

So what methods could be used to 'legitimise' this module/applet?
How much would it cost to ensure this applet is safe to run with no
warnings or errors?

I can understand everyone blocking activeX, but java runs in a
sandbox doesn't it? Doesn't that mean it's safer?

Is no-one else excited about having an applet prepare photos before upload?

pre911mindset’s picture

1) applets running 'in the sandbox' cannot access local files, and thus are useless for this purpose, and really any purpose.
2) Any application that can access your local files, including the browser you are currently using, and any of the countless other programs on your computer that do anything remotely useful, could cause you harm. Thus, browsers require that applets with this privilege be signed.
3) self-signed certs come with a warning when downloaded, see the link below as to why.

http://en.wikipedia.org/wiki/Self-signed_certificate

pre911mindset’s picture

It is now an official drupal module.

http://drupal.org/node/305203/release