Tags: files

25

sparkline

Sunday, December 2nd, 2018

One Time File

Drag and drop a file up to 400MB and share the URL without a log-in (the URLs are using What Three Words).

Tuesday, November 13th, 2018

Optimise without a face

I’ve been playing around with the newly-released Squoosh, the spiritual successor to Jake’s SVGOMG. You can drag images into the browser window, and eyeball the changes that any optimisations might make.

On a project that Cassie is working on, it worked really well for optimising some JPEGs. But there were a few images that would require a bit more fine-grained control of the optimisations. Specifically, pictures with human faces in them.

I’ve written about this before. If there’s a human face in image, I open that image in a graphics editing tool like Photoshop, select everything but the face, and add a bit of blur. Because humans are hard-wired to focus on faces, we’ll notice any jaggy artifacts on a face, but we’re far less likely to notice jagginess in background imagery: walls, materials, clothing, etc.

On the face of it (hah!), a browser-based tool like Squoosh wouldn’t be able to optimise for faces, but then Cassie pointed out something really interesting…

When we were both at FFConf on Friday, there was a great talk by Eleanor Haproff on machine learning with JavaScript. It turns out there are plenty of smart toolkits out there, and one of them is facial recognition. So I wonder if it’s possible to build an in-browser tool with this workflow:

  • Drag or upload an image into the browser window,
  • A facial recognition algorithm finds any faces in the image,
  • Those portions of the image remain crisp,
  • The rest of the image gets a slight blur,
  • Download the optimised image.

Maybe the selecting/blurring part would need canvas? I don’t know.

Anyway, I thought this was a brilliant bit of synthesis from Cassie, and now I’ve got two questions:

  1. Does this exist yet? And, if not,
  2. Does anyone want to try building it?

Monday, November 12th, 2018

Squoosh

A handy in-browser image compression tool. Drag, drop, tweak, and export.

Tuesday, July 10th, 2018

When 7 KB Equals 7 MB - Cloud Four

I remember Jason telling me about this weird service worker caching behaviour a little while back. This piece is a great bit of sleuthing in tracking down the root causes of this strange issue, followed up with a sensible solution.

Sunday, June 17th, 2018

Detecting image requests in service workers

In Going Offline, I dive into the many different ways you can use a service worker to handle requests. You can filter by the URL, for example; treating requests for pages under /blog or /articles differently from other requests. Or you can filter by file type. That way, you can treat requests for, say, images very differently to requests for HTML pages.

One of the ways to check what kind of request you’re dealing with is to see what’s in the accept header. Here’s how I show the test for HTML pages:

if (request.headers.get('Accept').includes('text/html')) {
    // Handle your page requests here.
}

So, logically enough, I show the same technique for detecting image requests:

if (request.headers.get('Accept').includes('image')) {
    // Handle your image requests here.
}

That should catch any files that have image in the request’s accept header, like image/png or image/jpeg or image/svg+xml and so on.

But there’s a problem. Both Safari and Firefox now use a much broader accept header: */*

My if statement evaluates to false in those browsers. Sebastian Eberlein wrote about his workaround for this issue, which involves looking at file extensions instead:

if (request.url.match(/\.(jpe?g|png|gif|svg)$/)) {
    // Handle your image requests here.
}

So consider this post a patch for chapter five of Going Offline (page 68 specifically). Wherever you see:

if (request.headers.get('Accept').includes('image'))

Swap it out for:

if (request.url.match(/\.(jpe?g|png|gif|svg)$/))

And feel to add any other image file extensions (like webp) in there too.

Friday, February 9th, 2018

Href Tools - Free online web tools

Handy web-based tools—compress HTML, CSS, and JavaScript, and convert files from one format to another.

Tuesday, January 16th, 2018

How To Make A Drag-and-Drop File Uploader With Vanilla JavaScript — Smashing Magazine

A step-by-step guide to implementing drag’n’drop, and image previews with the Filereader API. No libraries or frameworks were harmed in the making of this article.

Monday, September 11th, 2017

No space left on device – running out of Inodes – Ivan Kuznetsov

This blog post saved my ass—the Huffduffer server was b0rked and after much Duck-Duck-Going I found the answer here.

I’m filing this away for my future self because, as per Murphy’s Law, I’m pretty sure I’ll be needing this again at some point

Thursday, January 12th, 2017

Saving you bandwidth on Google+ through machine learning

This is an interesting use of voodoo magic (or “machine learning” as we call it now) by Google to interpolate data in a small image to create a larger version. A win for performance.

Thursday, March 24th, 2016

Angola’s Wikipedia Pirates Are Exposing the Problems With Digital Colonialism | Motherboard

The street finds its own uses for colonial internet practices:

Because the data is completely free, Angolans are hiding large files in Wikipedia articles on the Portuguese Wikipedia site (Angola is a former Portuguese colony)—sometimes concealing movies in JPEG or PDF files. They’re then using a Facebook group to direct people to those files, creating a robust, completely free file sharing network.

Wednesday, April 8th, 2015

CloudConvert - convert anything to anything

Ignore the silly name: this looks a supremely useful service—convert just about any file format into just about any other file format.

Friday, January 23rd, 2015

The Emularity « ASCII by Jason Scott

Jason documents some pretty amazing levels of emulation in JavaScript:

That’s Netscape 1.0n, released in December of 1994, running inside Windows 3.11, released in August of 1993, running inside of Google Chrome 39.0.2171.99 m, released about a week ago, on a Windows 7 PC, released in 2009.

But when it comes to trying to navigate the web with that set-up, things get a bit depressing.

Tuesday, December 2nd, 2014

On File Formats, Very Briefly, by Paul Ford · The Manual

A history lesson and a love letter to the early web, taking in HTML, Photoshop, and the web standards movement.

Those were long years, the years of drop-shadows. Everything was jumping just slightly off the screen. For a stretch it seemed that drop-shadows and thin vertical columns of text would define the web. That was before we learned that the web is really a medium to display slideshows, as many slideshows as possible, with banner ads.

Tuesday, June 24th, 2014

Permanence - Matt Gemmell

Some good ideas from Matt on the importance of striving to maintain digital works. I find it very encouraging to see other people writing about this, especially when it’s this thoughtful.

Thursday, January 17th, 2013

Song blogging: Files That Last

I hereby declare that this song is my official anthem.

I want some files that last, data that will not stray.

Files just as fresh tomorrow as they were yesterday.

Friday, October 26th, 2012

Just Solve the Problem Month 2012: Nitty Gritty « ASCII by Jason Scott

Jason goes into detail describing the File Format problem that he and others are going to tackle in the effort known as Just Solve The Problem.

Wednesday, March 21st, 2012

ARCHIVE TEAM: A Distributed Preservation of Service Attack - YouTube

Jason’s rip-roaring presentation from Defcon last year.

ARCHIVE TEAM: A Distributed Preservation of Service Attack

Thursday, March 1st, 2012

The Jason Scott Adventure | Glorious Trainwrecks

Download and play the Jason Scott Adventure — only you can help Jason save the internet!

Monday, August 17th, 2009

Re-finding five numbers

So, remember when I posted all those episodes of Simon Singh’s Five Numbers radio series on Pownce so that they’d have permanent URLs? Yeah, well, so much for that.

Fortunately Brian had saved all the MP3s. I’ve posted them on S3 and huffduffed them all. I can be fairly confident that Huffduffer won’t be going the way of Pownce, Magnolia, Geocities, and so many more.

Anyway, if you want to listen to the fifteen episodes of the three radio series’ on mathematics, you can subscribe to the podcast at https://huffduffer.com/adactio/tags/five+numbers/rss.

Or you can listen to each episode at these permanent URLs:

  1. Five Numbers

    1. A Countdown to Zero
    2. Simple as Pi
    3. The Golden Ratio
    4. The Imaginary Number
    5. Infinity
  2. Another Five Numbers

    1. The Number Four
    2. The Number Seven
    3. The Largest Prime Number
    4. Kepler’s Conjecture
    5. Game Theory
  3. A Further Five Numbers

    1. 1 — The Most Popular Number
    2. 2 — At The Double
    3. 6 Degrees of Separation
    4. 6.67 x 10^-11 – The Number That Defines the Universe
    5. 1729 — The First Taxicab Number

Friday, August 8th, 2008

Finding five numbers

I like Tumblr. I like Pownce. They both make it very quick and easy to post discrete quanta of information. I use Pownce for posting audio files and links to videos. I use Tumblr to post quotations. But both services suffer from the same problem: refindability.

Magnolia and Delicious encourage tagging. Those tags can then surface some pretty interesting aggregate behaviour but first and foremost, they’re useful for the individual doing the tagging. It’s pretty easy for me to track down something I bookmarked on Magnolia even if it was quite a while back. I don’t need to keep a list of all the tags I’ve ever used: I just need to search for a word that I think I might have used when I was tagging a bookmark. While it would be very difficult for me to try to second-guess how someone else might describe something, it’s usually pretty easy to put myself in the shoes of my past self.

As my store of data on Pownce and Tumblr increases, I’m starting to miss tagging (or any kind of search) more and more. Then again, I can understand why both services would resist that kind of scope creep. Both services rely on their simplicity. Adding another field to fill in could potentially be a road block between the user and the task they want to accomplish (although it doesn’t feel that way with Delicious or Magnolia). Update: it turns out that you can tag in Tumblr but it’s hidden behind the “advanced” link. Thanks to Keith Bell for pointing that out.

Here’s a case in point. Over time I’ve been posting MP3 files to Pownce of a series of radio programmes by Simon Singh, author of The Code Book — a superb piece of work. The audio from the radio programmes is available from the BBC website but only in Real Audio which, let’s face it, is complete pants. I originally got the MP3 files from Brian but after a catastrophic hard drive crash, I realised that it would be better to store them at an addressable URL. Besides, I wanted to geek out with my mathematically-minded friends. Pownce’s raison d’être is sharing stuff with friends so it seemed like the perfect home for the Singh files.

But without any kind of tagging or search, there’s no easy way for me or anyone else to revisit just those files at a later date. As a temporary patch, I’m listing the URLs for the Pownce posts that correspond to each episode. If you want to download the files, you’ll need to log in to Pownce.

  1. Five Numbers

    1. A Countdown to Zero
    2. Simple as Pi
    3. The Golden Ratio
    4. The Imaginary Number
    5. Infinity
  2. Another Five Numbers

    1. The Number Four
    2. The Number Seven
    3. The Largest Prime Number
    4. Kepler’s Conjecture
    5. Game Theory
  3. A Further Five Numbers

    1. 1 — The Most Popular Number!
    2. 2 — At the Double
    3. 6 Degrees of Separation
    4. 6.67 x 10-11 — The Number that Defines the Universe
    5. 1729 — The First Taxicab Number