ahye - a screenshot and image server

Posted: 2012-12-10 22:47   |  More posts about code

The problem

You want to share a screenshot of a part of your screen with a friend or colleague. While this is a little less convoluted on OS X, on Windows or Linux you will typically:

  • Press the print screen key
  • Open an image editor
  • Paste the contents of the clipboard
  • Crop the image so that only the relevant section is visible
  • Save this image as a new file
  • Close the image editor
  • Send the image file to your friend
  • Delete this file from your computer

By any measure, a very long, drawn-out procedure - not to mention the fact that your friend also has to accept the file transfer, find the file and open it, before deleting it, so as their Downloads folder or Desktop doesn't get cluttered.

Gyazo is a service that sprang up to solve this problem. Just run the program, select the area of your screen to take a screenshot of, and suddenly you're taken to the image hosted on the gyazo servers. The URL is also automatically copied to the clipboard, allowing the user to simply paste this URL to whomever they're collaborating with.

Sounds great! However, there are two main problems with using gyazo:

  • It is absolutely plastered in ads
  • Your screenshot now resides on someone else's server

The solution

ahye is a compact image server written in python to address this. It has two main features:

  • Compatibility with gyazo screenshooter clients (which are open source, and so can be used with any ahye server)
  • An additional web interface for uploading and mirroring images

Trying it out

If you would like to try ahye out without installing it, you can use a test server I've set up.

WARNING - This server is for experimental purposes only. I cannot guarantee any images saved to it will persist after a few minutes. If you like how ahye works, please set up and use your own server.

In order to use this test server, you can:

Setting up your own ahye server

Getting started with ahye is rather simple. In the next few days, I'll be also publishing a Chef cookbook that can be used to deploy ahye, but until then you can:

  • git clone git://github.com/kopf/ahye.git
  • pip install -r requirements.txt
  • python runserver.py
  • Download the gyazo client of your choice for your OS - there are a few listed in the repo's README
  • Make a small alteration to point the client to your server

Web interface

As mentioned above, ahye also provides a web interface for uploading and mirroring images. Simply visit the your ahye server in a browser and drag your image(s) into the browser window to upload it.

In order to mirror an image, simply append the URL of the image to your ahye server's url. So, let's say your ahye server is located at http://ahye.myweb.com, and you want to mirror the file http://i.imgur.com/EHWlL.jpg, you just have to go to http://ahye.myweb.com/http://i.imgur.com/EHWlL.jpg and your ahye server will automatically rehost the image and redirect you to its own copy.

If the URL to be mirrored has already been downloaded by the ahye server, it will be served without being re-downloaded and re-saved.

The future

ahye is far from perfect. It is designed - on purpose - as a literal 'black hole' for images: image histories or per-user images are both features beyond the scope of this project. The web interface is also a little clunky, with the jQuery fileupload plugin not being used to its fullest.

That being said, it is a tool that I and my colleagues at work use daily to make our lives easier. It does its job great, and it provides good peace-of-mind that I'm not going to accidentally save a segment of my credit card number somewhere where I can't delete it. (True story - this was the impetus for ahye)

So, give it a try, and if you're an open source developer yourself, please don't hesitate to fork and contribute!

comments powered by Disqus