The Fast & the Furious Users

Your next webapp better be fast and intuitive. Why? Because your users have no patience and will blame all their frustrations on “bad UX.”

For example, imagine an app where users submit links to hi-res images. What if the app:

  1. can only process JPGs & PNGs?
  2. requires images be least 600 pixels wide?
  3. accepts up to 10 URLs at a time?

That sounds pretty reasonable — but it could take ages to download, process, and report errors for every image. In the meantime, users will get bored and you'll never make it to the top of Product Hunt.

That’s why you need the FastImage Ruby gem from Stephen Sykes. Since most image formats store their metadata at the beginning, FastImage can extract size & format info without downloading the entire file.

For example, here’s a little routine our app could use:

```ruby require ‘fastimage’

def checkImg(x) puts “\nchecking: “+x

# size() returns [width, height] if FastImage.size(x)[0] >= 600 puts “size check - PASS” else puts “size check - FAIL” end

if [“jpeg”, “png”].include? FastImage.type(x).to_s puts “format check - PASS” else puts “format check - FAIL” end end

too small, wrong format, and just right

checkImg(“”) checkImg(“”) checkImg(“”)



#size check - FAIL #format check - PASS


#size check - PASS #format check - FAIL


#size check - PASS #format check - PASS ``` You can check the benchmarks in the readme, but trust me — it’s fast. And bonus: there are ports for Python, Go, and Swift.

Do you event comment bruh?
2017 Neal Shyam