241 points · by gmurphy · 16y ago · 106 comments
It's built on an App Engine backend, and the uploader relies on the PushState and the File API from HTML5, so it only currently works in Chrome 6 and Firefox 4*; supporting other browsers would be the first post-hack step if I were to take it further.
An example gallery can be found here: http://www.dropmocks.com/mSER
I had an itch to scratch around making it easy to share sets of images with other designers and thought that I could use the new drag and drop file support to solve it. DropMocks was the result after a quick weekend of hacking.
It's built on a simple Python App Engine backend, and the uploader relies on the PushState, File, and FileReader APIs (I realize that some of these aren't strictly HTML5), so uploads currently only work in Chrome 6+ and Firefox 3.6+; supporting other browsers would be the first post-hack step if I were to take it further.
An example gallery can be found here, it should be viewable in all modern browsers: http://www.dropmocks.com/mSER
Seriously, what a great project. If this is just a weekend project and a start for HTML5, I can't wait to see (and build) what's next.
The only time browser sniffing is ever appropriate is when you excluding a specific browser due to a bug, and there is no unobtrusive way to do so (e.g. a console.log bug that can't be tested without calling console.log() at least once).
I have spent many years of my life working on a browser that is frequently hurt by agent detection, so I'm well aware of the issues with the approach I took; and while I do think that there are a broad range of circumstances where it is appropriate, this is probably not one of them, so I accept your criticism and and pout into my bowl of ice-cream :)
Edit: I added your suggested code and am running through the tests now, thanks.
But for a 'weekend' project, that's pretty impressive.
Cool domain name; wish I'd thought of something that short.
Excellent job.
----
Edit: upon further inspection, it seems Gmail indeed does use Flash [1], just for a different part of the upload process (progress bar?).
Drag and drop is only supported in Chrome and Firefox [2], so I suppose this is HTML5.
[1] https://mail.google.com/mail/uploader/uploaderapi2.swf
[2] http://gmailblog.blogspot.com/2010/04/drag-and-drop-attachme...
I created a client-side image shrinker - demo at http://kimsal.com/shrinker - github at http://github.com/mgkimsal/jsclientshrinker Perhaps integrating this functionality for images that are 'too big' (whatever file size you decide) would be a nice enhancement? :)
Let me know how it works out for you :)
"Original file was: 137724 bytes Transmitted size was: 844176 bytes (due to base64) New file is: 633131 bytes"
Over the years we've come up with a few clever hacks to speed things up. For example, we keep our designs in svn and can quickly push updates live to our servers using a commit hook. But this is all sort of complicated, and I'd much rather use a web-app like this.
Dropmocks is very close to being the perfect tool for our workflow, and I suspect many other design/photo studios would feel the same way. A few features that folks like us would want/need: ability to pw protect galleries, ability to maintain revisions of designs, commenting (by both designer and client), and a way to export images to PDF.
Not sure if you'd target Dropmocks for businesses (such as ours), or if you'd like to have it open to the world and ad-supported. If the former, we're the kind of people that would sign up.
Suggestions:
- tif not recognized as image, probably other formats as well (someone below said an image without an extension was rejected, maybe you need a smarter file rejection algorithm)
- 900k is kinda small, maybe you should compress on-the-fly
- UI needs work: I want to leave my mouse in one place and just keep clicking for more images (I know arrow keys work, and that's great, but consistency is key), no matter the size or where in the list I am (the ends of the list seem to break this pretty badly), image sizes shouldn't affect placement, jumping around the list is hard, maybe instead of or in addition to the "inline" list representation, you could have a scrolling or static list of thumbnails on top or bottom
- the blur is too heavy. I already can't see much of the previous or next images because the one in front is too big, so why are they so occluded? Tone it down, maybe desaturate them a little too if you feel like less blur wouldn't take them enough out of the foreground
In particular, you know what would make this rock*10^6? facebook/dropbox integration.
I just posted the source: http://github.com/glenmurphy/dropmocks
Also, to my phone. When I take a picture on my phone, I want it to sync to a dropbox folder.
Also, with facebook. I want each of my picture galleries to sync with a mock (and, optionally, to a dropbox).
Let's say a mock is synced with both dropbox and facebook. Then adding a file to the folder locally on a machine, it should push to mock, then from mock to facebook.
Meta-question: if a Chrome extension uses significant server-side resources, should one ask the site host first? (legally, I think the answer is "no")
edit: oh, and you might want to make sure the images in the "back" are (proportionally?) smaller than the ones in front - if you shrink your window a lot they're actually bigger.
edit 2:
Gets stuck occasionally, though so far only while loading, and doesn't seem to respond to any interaction. The drop-down still works though, so it appears it's not just spinning.
Anyone else, and/or any info I can provide to get you info on why?
In any case, gorgeous work :)
// HAMLET HAMLET HAMLET
function isValidBrowser() {
var browser = BrowserDetect.browser;
var version = BrowserDetect.version;
return (
(browser == 'Chrome' && version >= 6) ||
(browser == 'Firefox' && version >= 3.6)
);
}Should we be spreading this? Or might doing so tank your server / storage / bank account? Do you have any limits in place to protect you?
Nightly WebKit builds may work.
However, I dragged an image ( but did not have any extension) - and it mentioned that the file is not an image.
I know this is a rare case ( heck what are the odds of me selecting me 1 pic which does not have an extension!) Anyways, good stuff.
EDIT: Seems the issue has been resolved. It's working for me on both browsers now.
(Reason #101 why I hate browser sniffing, no one ever gets it right).
Beyond that, I wish you the best of luck, it sounds like something I can use.
Privacy can be an issue if the secret url leaks. Maybe a visit count/log (to detect leaks) and a (change) option (to get a new url and close the previous one).
Its listed under GPU Process in Chromium. I guess it is a Chromium problem.
Cause: In order to make the open source distribution cleaner, I moved the app.yaml into the same directory as the other files. It was previously in the directory above, so my static_dir declaration went from source/files to ./files; the local App Engine development server handled the ./ notation fine, but the deployed one did not.
I am currently studying your code. Thanks for making it available.
Without that context it is just magic(and even then idea and implementation is great). But I think there must be something many of us can do in a weekend that will look like magic. But it was possible because of months/years of experience.
Where to go from now, launching image service (flickr) or making this open source (e.g. light box) - up to you
Your shadows look very odd with the very horizontal screenshots I dragged in to test it.
What did you write it in?
Having to resize images before the upload is a deal breaker.
cool project
Small feature request: link to particular image with #
Love the project!
http://code.google.com/appengine/docs/python/blobstore/overv...
It takes a bit more work but you could store the original file since it has a 2GB limit. You can only fetch 1MB at a time but it should still be doable.
I hope there is a NaCl version :)
Edit: Works now! Thanks.