Hacker Newsnew | past | comments | ask | show | jobs | submit | choonkeat's commentslogin

but upgrade guide says its ok "talk things through" on the issues page, so I posted my solution there

https://github.com/avh4/elm-upgrade/issues/44


While the Ruby community wasn’t looking, the rest of the world has moved on to having standalone servers to manage & process their file uploads.

Latest example: https://medium.com/medium-eng/the-stack-that-helped-medium-d...


Here's a take down of all approaches. https://www.slideshare.net/choonkeat/file-upload-2015

TLDR: forget shrine too, use an image server


Very interesting presentation, really on a high level, I enjoyed reading it.

I noticed that many problems that you mention other uploading gems have are actually solved by Shrine:

- "Transformation juggling" -- Versions are processed at instance-level, so you don't need to remember a class-level DSL.

- "File path config" -- If you change the location where your files are stored, the existing files on old locations will still work normally

- "Form validation dance" -- Very simple with Shrine, you just add an "<attachment>" hidden field.

- "Schema pollution" -- Shrine stores uploaded files exactly in the way that you described, in a single column as JSON

The idea of an image server indeed looks very interesting, but I think you're forgetting that this solves only one part of file uploads (although I agree it's a big part, and imgix looks really sexy). If you're using an image server, you still need to do:

- Caching the file (this still needs a direct upload endpoint)

- File validations (most notably preventing big files)

- Storing the file to image server (this still needs a background job)

- Model attachment logic (all of the assignment/callback logic)

One problem that I always had with on-the-fly processing is, if you have a page with a lot of photos, and you want to change the URL so that they're processed differently, how will that page look when a first person visits it? I think it will be horrible, the user will have to wait for a really long time to actually see the images, which is not nice user experience.

Also, the "image server" strategy can be used only for images, so if you want to upload documents, audio or video, you still need do regular processing on the application side. What's nice about uploading gems is that they provide a general solution.


sorry didn't see this reply. i'll copy-paste my reply http://blog.choonkeat.com/weblog/2015/10/file-uploads-2015.h... for posterity ;-)

> If you're using an image server, you still need to do...

yes and we should move towards solving issues in the image server, not yet another client gem

> File validations (most notably preventing big files)

big file upload can equally be prevented on image server as on a rails server, settings should be in the webserver fronting it.

validations are "easy" since you're only validating json attributes, but i guess as u mentioned, shrine has this benefit too.

> Storing the file to image server (this still needs a background job)

even better than background job: we always direct upload from browser/client (regardless of whether we are using s3 or not).

> Model attachment logic (all of the assignment/callback logic)

a client lib can do this for your rails app. and it isn't much https://github.com/choonkeat/a...

> One problem that I always had with on-the-fly processing is, if you have a page with a lot of photos, and you want to change the URL so that they're processed differently, how will that page look when a first person visits it? I think it will be horrible, the user will have to wait for a really long time to actually see the images, which is not nice user experience.

we can still "pregenerate" after the author uploads his images, the browser just have to make the requests (not necessarily visible) and the image servers can cache those generated images for a long long time. then when the "first other person" view the page, those images are as fast as anything.

storing the generated image or not is still an image server's decision. my own implementation chose not to store because i find those generated files more trouble to carry around.

again, these are things for different image servers to iron out and one-up each other with.

> Also, the "image server" strategy can be used only for images, so if you want to upload documents, audio or video, you'll need to use something else. What's nice about uploading gems is that they provide a general solution.

actually, there's nothing in an image server that makes it inherently image only. i'd say file servers provide as general a solution as those uploading gems

for example, attache server handles pdf uploads well and even renders the thumbnail when requested via <img src="">. the same applies for any other file types - the goal is actually to render thumbnails for everything, as per how your desktop renders the same files are thumbnails.

again, these are things for different image servers to one-up each other with.


having an image server with apis solves 80% of the problem.

having a client counterpart lib to ease you in solves the other 80% https://github.com/choonkeat/attache_rails

being able to host it yourself solves the last 20% https://github.com/choonkeat/attache


The imgix sandbox is meant as a tool to experiment and try things out.

Behind the scenes it uses imgix's production infrastructure via the published API. We think it's really helpful to be able to quickly iterate over ideas, and we plan to use it ourselves within our API documentation.

The imgix API is documented over at https://www.imgix.com/docs/reference

Client libraries are at https://www.imgix.com/docs/libraries

(also, I think your percentages may overflow)


Assuming you're not using ImageMagick, what are you using and what makes your solution superior? Do you have any benchmarks comparing against ImageMagick/GraphicsMagick?


(Employee of imgix here.)

Most of our feature benefits are derived from being a "full-stack" imaging solution. Because we know a lot more about the request and the client, we're able to perform operations to deliver the best image possible. One of the ways we do this is our automatic content negotiation strategy, which will serve up WebP images for Chrome, JPEG XR for IE 10+, etc. These more modern file formats tend to be much smaller, with some of our customers seeing a 40% reduction in their CDN bills as a result.

We're also able to push all of the work to our GPUs on our servers without worrying about noisy neighbors. This means our mean render time is 80ms, with the 90th percentile being 150ms. We wrote about our solution of racking Mac Pros: http://photos.imgix.com/racking-mac-pros

Sure, you can configure your own ImageMagick setup to do all of this. As you build this out, whether as an internal or external service, the economic realities of running ImageMagick in a virtualized environment catch up with you. It’s difficult to do this affordably and in a set-it-and-forget-it manner.

When explaining the benefits of imgix, I'm often reminded of the old jwz quote, "Linux is only free if your time has no value." Having stood up a few ImageMagick instances at previous jobs, I was happy to see imgix come along. Fast-forward a few years, and now I work there :)


Rather than ImageMagick, how do your benchmarks compare against libvips?

http://sharp.dimens.io/en/stable/


Not sure. We'll have to run some on our end and get back to you.


See also: https://news.ycombinator.com/item?id=8440351 (written by another imgix employee)


can this finally be the app that let me surf trailers, click like and send me push notification when the movie is out ??

(or available on itunes or netflix)


By any chance have you come across Trailers (Apple's own movie app) which does exactly what you describe with notifications for your favorite movies.

https://itunes.apple.com/us/app/itunes-movie-trailers/id4719...


Of course I have :) I used to use a combination of Trailers, Flixster, IMDB, and Fandango for my movie needs. This is sort of an amalgamation of all that with my twist.


oh wow. with their trailer website lacking it, appletv wishlist feature as toothless, i really didn't think they'd bother with it in an app. thanks


You can surf trailers right now - there's a whole trailers section. Notifications are coming in the next version - with the use cases you mentioned (when the movie is out in theaters or available on itunes etc)


but why?


great idea! but is it necessary ux to burden the human user to manually trigger unlock? form onfocus or page onload should be less intrusive and still serve the purpose


Other types of widgets can be built on top of API. jQuery.hashcash.io plugin is just one implementation. API docs are yet to be built tho :)


everyone-pays model works very well for everyone. since 2005. http://rssforward.com/


"Your phone wasn't able to record all of the movement. Please try again"

can't get past 2 walls. iphone 4s


timeline: like! i wish more news sites presents history in a straightforward manner colors: not so much; not meaning & some combi are hard to read; favicon/logo/color-scheme-based-on-logo will be more useful http: if the form method is "GET", then I can easily share or bookmark for updates later text: some body text will be nice


Thanks for your suggestions, hoping to get all of these sorted out over the next week or so :)

Trying to find open API's with quality content is a bit tricky though - so that could be the breaking of this project!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: