• Welcome to Randomland - The Forum. Please login or sign up.
 
May 03, 2024, 12:42 AM

News:

Get Out, See Green!


Simple image server

Started by zourtney, Aug 05, 2013, 12:26 AM

Previous topic - Next topic

zourtney

I dusted off my old Python pants and whipped out a very simple image server. Just feed it a path and the target image size, and you'll get an image back. Downsized images are stored on disk, then cleaned up every-so-often.

Its usage is simple enough, though could use some perfecting:
    host:port/[size]/[path]

Where:

  • size is the longest edge of the returned image
  • path is the path to the image on the server
For example, we could have
img.randomland.net/1024/zourtney/2013-campcamp/IMG_0001.JPG

I haven't stress tested it at all, and is probably an overly simplistic implementation. But! for our purposes, it could work ok. We could use it to pull from remote sources (ala Flickr, Google Plus), temporarily keep downsized copies on the Randomland server, then eschew them when no one has looked at them for, say, a week.

A step further: add a metadata service that outputs tags, face regions, EXIF data, etc. If there's an open API for it, the server can remain a middleman with no regard for datin'bases or such fancy extravagancies.

Ok, REALLY time for bed.

zourtney

Future me: (or anyone interested) I think my next step for this is to repurpose this thing as an image aggregator. Its purpose would be to funnel images from local and external sources transparently. Maybe we use a lightweight database and associate generated "permalink" URLs with image URLs (for brevity and source masking). So, essentially it'd be a URL shortening service that serves image/[type] content instead of triggering a redirect...sounds so simple that there's probably something our there already.

Nick

Yeah, probably something already. But is it easy to incorporate into other projects? And yeah, it is so simple that there is no need to rely on other people for that part.


So you are thinking something tied to flickr and G+ and local and network shared (samba shares over the internet via  hamachi?) and pool them all together for a central place to share/view/organize them? Sounds cool. I'm in. This would be a good tool for use with the Super Digital Photoframe we were all (ok Brad was) talking about the other week. Anything I can do to help? Need a web interface to view all this stuff? (I wish the G+ photo stuff was Open Source. That would be a nice base to work from in making a custom image manager. Kinda an online Lightroom.)

zourtney

Nick: linking your image server software find for posterity's sake.

As for the questions above: yes to most, if this is even worth putting effort into.

  • Yes, something that holds references to image URLs on G+, local directories, remote directories, Flickr, etc. It just needs to be an unintelligent lookup table, with the ability to send back downscaled copies.
  • Yes, it'd probably be helpful for that awesome picture frame idea :)
  • Yes, I could use help...unless that OpenPhoto thing can trump it. Or that everyone having high bandwidth trumps the whole idea of sending downscaled copies in the first place (not likely).
  • Sorta needs a UI. At this point in life, I'm actively avoiding the idea of making any sort of gallery software. It's been done, and it's been done well (G+'s is my favorite, currently). What it would need is a UI to either:

    • a) feed it some source directories, RSS feeds, etc which it then gobbles up and generates some predictable shortish URL or
    • b) a textbox where you enter a source URL for a single image which it then stores and gives you back some manageable sized hash (like bit.ly, goog.le, tinyurl, etc)



So, the whole concept of an image server screams "scope creep". Let's be practical and define what we're actually trying to solve here:

The Problems:

  • Our images are scattered across multiple internet-attached medium. This isn't a problem we can fix.
  • Over time, Randomland-hosted images have moved, breaking links in the process. The only option is to re-upload and manually fix all references to all moved images.
  • Using Drupal 6's ImageCache setup has proven to be fragile. Currently, all thumbnails are broken links :(

The Objectives:

  • Provide a common interface to access images amongst disparate sources.
  • Provide an interface that downsizes these images on demand.
  • Provide a way to rectify broken sources.

Any input on the high-level ideas here?