Friday, July 18, 2014

Upcoming Features

The past week I've been working day and night readying the website for launch. Now that the thing is up and running, I can spare some thoughts on future development. There were a number of features that were conceived but that I decided to put off implementing. By far the biggest one is the generation of higher-resolution mosaics.

Currently, the site generates mosaics as 5120x3840 JPEG files (or somewhat shorter, depending on the aspect ratio of the source photo). The resolution is larger than most people's monitors. If you print one out on your inkjet printer, you'd get roughly 500 DPI. The result will look decent. For printing in larger formats though, that's inadequate.

In theory, the system can generate mosaics that are 8 times wider. Instead of resizing tiles to 128x96, I can make each of them 1024x768. That should yield enough pixels for printing a 36" by 24" poster at 1200 DPI. JPEG files that are 40,000 pixels aren't terribly practical, of course--the server would run out of memory creating them. PDF is the file format of choice here.

I happen to have quite a bit of experience with PDF. I will probably code the software from scratch instead of using an existing package. Should be fairly straight forward. The PDF file will basically contain a couple thousand individual JPEG files, with commands to arrange them into a grid. Given the large file size, I'll probably set it up so that the images are processed as the file is downloaded.

As there's no completed mosaics yet, I should have plenty of time to work on this before it's needed.

Another feature that'll likely appear in the near future is the ability to adjust the GPS location of photos. It's probably be a button that unlocks the pin on the map, allowing you to drop it where it really belongs.

Thursday, July 17, 2014

The Technologies behind Tourismosa

Much like the photo mosaics it creates, Tourismosa is a mashup of a variety of Internet technologies. For people interested in how things work, here's a brief description of what's involved:

The website runs on a LAMP virtual server, utilizing Amazon's EC2 service. Currently, the resources available are quite modest, equivalent to a dual-core CPU with 4GB of RAM. As demand grows, I'll migrate the server to better hardware.

Submitted photos and pictures generated from them are stored on Amazon S3. S3 also stores the site's daily database backup.

Varnish is used to improve site responsiveness. Zend OPCache is present for the same reason.

Gearman is used to run time-consuming tasks such as tile-matching and mosaic rendering. Gearman Manager is used to manage worker processes.

The OAuth 2.0 client created by thephpleague is used for authentication through social login. Currently, four networks are supported: Facebook, Microsoft Live, Google Plus, and Instagram.

The GD PHP extension handles reading and writing of JPEG files as well as image scaling.

The QB PHP extension is used in computationally intensive image analyses and manipulations. QB-accelerated code also handles geo-location of IP addresses (using data files provided by MaxMind).

Mapbox is used to obtain city names from GPS coordinates (reverse geocoding). The web service is also used to parse search queries (forward geocoding).

On the frontend, JQuery is used for basic Ajax transactions.

Dropzone.js handles both “drag-and-drop” and “browse-to-file” uploads. The file submission feature is supplemented by Dropbox's Chooser API, allowing rapid transfer of already-uploaded files within the Amazon cloud.

Leaflet provides the interface for maps that appear on this website.