<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,11 +2,11 @@
 
 Gem::Specification.new do |s|
   s.name = %q{encosion}
-  s.version = &quot;0.3.0&quot;
+  s.version = &quot;0.3.1&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Rob Cameron&quot;]
-  s.date = %q{2009-08-04}
+  s.date = %q{2009-11-09}
   s.email = %q{cannikinn@gmail.com}
   s.extra_rdoc_files = [
     &quot;LICENSE&quot;,</diff>
      <filename>encosion.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -12,12 +12,13 @@ require 'yaml'
 # internal
 require 'encosion/base'
 require 'encosion/video'
+require 'encosion/image'
 require 'encosion/playlist'
 require 'encosion/exceptions'
 
 module Encosion
   
-  VERSION = '0.3.0'
+  VERSION = '0.3.1'
   LOGGER = Logger.new(STDOUT)
   
   SERVER = 'api.brightcove.com'</diff>
      <filename>lib/encosion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,90 @@
+module Encosion
+
+  class Image &lt; Base
+    ENUMS = { :image_type =&gt; { :thumbnail =&gt; &quot;THUMBNAIL&quot;, :video_still =&gt; &quot;VIDEO_STILL&quot;}}
+
+    attr_accessor(
+      :name,
+      :type,
+      :reference_id,
+      :remote_url,
+      :video_id
+    )
+
+    #
+    # Class methods
+    #
+    class &lt;&lt; self
+
+      # the actual method that calls a post (user can use this directly if they want to call a method that's not included here)
+      def write(method, options)
+        # options.merge!(Encosion.options)
+        options.merge!({:token =&gt; Encosion.options[:write_token]}) unless options[:token]
+
+        Image.post( Encosion.options[:server],
+                    Encosion.options[:port],
+                    Encosion.options[:secure],
+                    Encosion.options[:write_path],
+                    method,
+                    options,
+                    self)
+      end
+
+    end
+
+    #
+    # Instance methods
+    #
+    def initialize(args={})
+      @video_id = args[:video_id]
+      @name = args[:name]
+      @reference_id = args[:reference_id]
+      @remote_url = args[:remote_url]
+      @type = args[:type]
+    end
+
+
+    # Saves an image to Brightcove. Returns the Brightcove ID for the image that was just uploaded.
+    #   new_image = Encosion::Image.new(:remote_file =&gt; &quot;http://example.com/image.jpg&quot;, :display_name =&gt; &quot;My Awesome Image&quot;, :type =&gt; &quot;VIDEO_STILL&quot;, :video_id = &gt; &quot;brightcove_video_id&quot;)
+    #   brightcove_id = new_image.save(:token =&gt; '123abc')
+
+    def save(args={})
+      # check to make sure we have everything needed for a create_video call
+#      raise NoFile, &quot;You need to attach a file to this video before you can upload it: Video.file = File.new('/path/to/file')&quot; if @file.nil?
+      options = args.merge({ 'image' =&gt; self.to_brightcove, :video_id =&gt; self.video_id }) # take the parameters of this video and make them a valid video object for upload
+      options.merge!({:token =&gt; Encosion.options[:write_token]}) unless options[:token]
+      response = Image.post(Encosion.options[:server],
+                            Encosion.options[:port],
+                            Encosion.options[:secure],
+                            Encosion.options[:write_path],
+                            'add_image',
+                            options,
+                            self)
+      return response['result'] # returns the Brightcove ID of the video that was just uploaded
+    end
+
+
+    # Output the image as JSON
+    def to_json
+      {
+        :name =&gt; @name,
+        :remote_url =&gt; @remote_url,
+        :type =&gt; ENUMS[:image_type][@type],
+        :reference_id =&gt; @reference_id
+      }.to_json
+    end
+
+
+    # Outputs the image object into Brightcove's expected format
+    def to_brightcove
+      {
+        'displayName' =&gt; @name,
+        'remoteUrl' =&gt; @remote_url,
+        'type' =&gt; ENUMS[:image_type][@type],
+        'referenceId' =&gt; @reference_id
+      }
+    end
+
+  end
+
+end</diff>
      <filename>lib/encosion/image.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>733e465c8907d7b7821857a9afabe03c512a1366</id>
    </parent>
  </parents>
  <author>
    <name>Bruce Krysiak &amp; Zach Legein</name>
    <email>pair-bruce-and-zach@honk.com</email>
  </author>
  <url>http://github.com/honkster/encosion/commit/33c495b81c65934c5b63898614d7e571547ae93b</url>
  <id>33c495b81c65934c5b63898614d7e571547ae93b</id>
  <committed-date>2009-11-09T12:54:34-08:00</committed-date>
  <authored-date>2009-11-09T12:54:34-08:00</authored-date>
  <message>Added image functionality and updated gemspec</message>
  <tree>7ef3d4678d87372b437ebb0bde5bcfb7867b19d6</tree>
  <committer>
    <name>Bruce Krysiak &amp; Zach Legein</name>
    <email>pair-bruce-and-zach@honk.com</email>
  </committer>
</commit>
