Project

smugimg

0.0
No commit activity in last 3 years
No release in over 3 years
SmugImg is able to parse the GUID to a SmugMug photo and generate URLs to that image at any given size.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.4
~> 3.1
 Project Readme

SmugImg: SmugMug photo URLs at any given size.

Travis CI build status

SmugImg parses GUIDs to photos at SmugMug, and is then able to generate a URL to your image at any given size.

This gem is a bit of reusable logic that I'm extracting from my personal site. I use it to implement a custom liquid tag which generates URLs and IMG tags for my photos.

This isn't an official SmugMug gem. I'm not affiliated with the company SmugMug.

Installation

Install the gem manually:

gem install smugimg

Order add it to your Gemfile:

gem 'smugimg'

Usage

Create an instance of a SmugImg::Image using a photo GUID. One place you can get these from is from your feeds.

# Hard-coded image guid for display purposes only.
ex_img = "http://galleries.thetomharrison.com/Portfolio/Output/i-4pJNdH6/0/Th/20150109-090134-xt1-Th.jpg"

img = SmugImg::Image.new(ex_img)

You can use all of the pre-defined sizes:

%w{Ti S M L XL X2 X3 O}.each do |s|
  puts img.at_size(s)
end

Or you can use custom dimensions in the form of 'WIDTHxHEIGHT':

puts img.at_size('500x250')

Tests

Run the rspec tests with rake:

rake

Authors

License

MIT