swdyh / quilt

a ruby library for generating identicon

This URL has Read+Write access

swdyh (author)
Fri Sep 19 05:28:47 -0700 2008
commit  504c3aee7df8f135bb0fad83f3c18eaf498b9966
tree    e415a53d71f7f7a18736839168b5cb292f967b21
parent  ce5cb6d7cc9a804df7bfbc56e68cc88ee1d0ea08
quilt /
name age message
file ChangeLog Thu Jun 19 05:26:46 -0700 2008 * added ChangeLog. (rename Changelog to Change... [swdyh]
file MIT-LICENSE Sat May 10 03:43:57 -0700 2008 first commit [swdyh]
file README.rdoc Sun Jun 15 06:51:01 -0700 2008 * rename README [swdyh]
file Rakefile Fri Sep 19 05:28:47 -0700 2008 * added updat_gemspec task [swdyh]
directory lib/ Fri Sep 19 05:15:44 -0700 2008 * fixed draw algorithm. [swdyh]
file quilt.gemspec Fri Sep 19 05:28:20 -0700 2008 * update gemspec [swdyh]
directory test/ Sun Jun 08 04:53:27 -0700 2008 * added size optoion. [swdyh]
README.rdoc

quilt

Description

a library for generating identicon.

Identicon: en.wikipedia.org/wiki/Identicon

Installation

Required RMagick or ruby-gd.

Archive Installation

        rake install

Gem Installation

        gem install quilt

Features/Problems

  • Output file type is PNG only.

Synopsis

        # input: any string
        # output: 15 * 15 png (default)
        identicon = Quilt::Identicon.new 'sample'
        identicon.write 'sample15_15.png'

        # input: identicon code(32 bit integer)
        # output: 15 * 15 png (default)
        identicon = Quilt::Identicon.new 1, :type => :code
        identicon.write 'sample15_15_code.png'

        # input: ip address
        identicon = Quilt::Identicon.new '100.100.100.100', :type => :ip
        identicon.write 'sample15_15_ip.png'

        # output: 150 * 150 png
        identicon = Quilt::Identicon.new 'sample', :scale => 10
        identicon.write 'sample150_150.png'

        # output: blob
        identicon = Quilt::Identicon.new 'sample'
        print identicon.to_blob

        # change image library to Rmagick to  GD
        Quilt::Identicon.image_lib = Quilt::ImageGD
        identicon = Quilt::Identicon.new 'sample'
        identicon.write 'sample15_15_gd.png'

Copyright

Author:swdyh <youhei@gmail.com>
Copyright:Copyright © 2008 swdyh
License:The MIT License