Home

Flickr is giving users a full terabyte of space, but has limitations in place for content.  This guide shows you how to store any file on Flickr, including RAW images, ZIP files, and any other content.  This process isn't very quick or very easy, but it allows you a free terabyte of cloud storage.

Background

According to Flickr's Help Page, the following picture formats are allowed:
  • JPEG
  • GIF (non-animated)
  • PNG

File sizes are up to 200 megabytes.

Although data can be crammed into JPEG and GIF files, PNG is the only lossless format.  Therefore, a 100 megabyte file could be contained in a PNG picture of about the same size.  This is the route I take for this guide.

Flickr also supports videos up to 1 gig in size.  This could make a better container, but you'd need a lot of bandwidth and processing power to work with these.


Code

The programs I wrote are in C.  They aren't very complicated.  You're welcome to use them however you want.  Use the "compile.sh" script in linux, or type in the commands manually, to create the binaries.  I'm sure MinGW can compile these for Windows too, but I haven't done it yet.

>> Download the files at the bottom of this page <<


How it works

You'll be making a computer-generated picture.  Your input file (RAW, ZIP, whatever) will become pixels in the picture, along with some header data.  The data is packed in order, starting with pixel 0,0 Red, Green, and Blue, then pixel 0,1 RGB, and so on.  It creates a 24-bit PNG.  (RGB only, no alpha.)  The "flickr_encode" program computes the size of the picture and packs the data as follows:

  • Filename as ASCII, null-terminated.
  • 4 bytes representing the size of the data file.
  • Raw data from the file.
  • Any remaining pixels are black (but it doesn't matter).

Reversing this process, the "flickr_decode" program does the following:

  • Does a string copy until it hits the null-terminator for the filename.
  • Reads 4 bytes for the filesize (F).
  • Reads (F) bytes and saves it to file "filename".


Demo

In this demo, I'll store a RAW image, a bitmap (BMP), and a large video file on Flickr.  Since the video is too big (more than 200 megs), I use 7zip (or could use a RAR container) to split it into multiple 150 meg files.  Using this, we have the added bonus of encrypting the data.

SAM_4316_small.BMP

SAM_4316.SRW

video.mp4.7z.001

video.mp4.7z.002


Run the flickr_encode command:

$ ./flickr_encode SAM* video*

File SAM_4316_small.BMP.png size 180054 Encoding...

File SAM_4316.SRW.png size 20746632 Encoding...

File video.mp4.7z.001.png size 157286400 Encoding...

File video.mp4.7z.002.png size 157138687 Encoding...

The resulting PNG files are ready to upload to Flickr.


To validate the data, download the PNGs from Flickr and run the flickr_decode tool:

$ ls *.png

whatever1.png  whatever2.png  whatever3.png  whatever4.png

$ ./flickr_decode *.png

File SAM_4316.SRW size 20746632 decoded

File SAM_4316_small.BMP size 180054 decoded

File video.mp4.7z.001 size 157286400 decoded

File video.mp4.7z.002 size 157138687 decoded

At this point, you have the original files back.


Issues / Enhancements

Flickr is made for organizing pictures.  In Flickr's "Film Roll", the filenames are completely hidden.  Since all the pictures end up being a snowy grey, it's difficult to find the file you need.  Future implementations could allocate some space in the photo for displaying the filename or some kind of identifier, or even using a "cover picture" overlay.  A cover picture would be perfect for storing RAW images.  Say, 3 pixels for data and 1 pixel from the cover picture, so when the image size is reduced the picture is grey-washed but visible.


ċ
backup_to_flickr_source.zip
(70k)
Doug Hickok,
Dec 14, 2015, 6:50 PM