<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,7 +14,7 @@ class GalleryItem &lt; ActiveRecord::Base
   
   attr_accessible :name, :description, :uploaded_data, :keywords
   
-  has_attachment :storage =&gt; :file_system,
+  has_attachment :storage =&gt; Radiant::Config[&quot;gallery.storage&quot;].to_sym,
     :path_prefix =&gt; Radiant::Config[&quot;gallery.path_prefix&quot;],
     :processor =&gt; Radiant::Config[&quot;gallery.processor&quot;],
     :max_size =&gt; Radiant::Config[&quot;gallery.max_size&quot;].to_i.kilobytes     
@@ -29,7 +29,7 @@ class GalleryItem &lt; ActiveRecord::Base
   has_many :infos, :class_name =&gt; &quot;GalleryItemInfo&quot;, :dependent =&gt; :delete_all
   
   has_and_belongs_to_many :gallery_keywords, :join_table =&gt; &quot;gallery_items_keywords&quot;, :foreign_key =&gt; &quot;gallery_item_id&quot;, :uniq =&gt; true,
-                            :class_name =&gt; &quot;GalleryKeyword&quot;, :association_foreign_key =&gt; &quot;keyword_id&quot;
+    :class_name =&gt; &quot;GalleryKeyword&quot;, :association_foreign_key =&gt; &quot;keyword_id&quot;
 
   before_create :set_filename_as_name
   before_create :set_position
@@ -104,7 +104,11 @@ class GalleryItem &lt; ActiveRecord::Base
   def full_filename(thumbnail = nil)
     file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s
     gallery_folder = self.gallery ? self.gallery.id.to_s : self.parent.gallery.id.to_s
-    File.join(RAILS_ROOT, file_system_path, gallery_folder, *partitioned_path(thumbnail_name_for(thumbnail)))
+    if Radiant::Config[&quot;gallery.storage&quot;].eql?(&quot;s3&quot;)
+      File.join(file_system_path,gallery_folder, thumbnail_name_for(thumbnail))
+    else
+      File.join(RAILS_ROOT, file_system_path, gallery_folder, *partitioned_path(thumbnail_name_for(thumbnail)))
+    end
   end
   
   def last?
@@ -114,15 +118,15 @@ class GalleryItem &lt; ActiveRecord::Base
   def generate_default_thumbnails      
     if self.thumbnailable? and default_thumbnails = Radiant::Config['gallery.default_thumbnails']
       default_thumbnails.split(',').each do |default_thumbnail|
-         if default_thumbnail =~ /^(\w+)=([a-z])?(\d+)?x(\d+)?([%!&lt;&gt;@]?)$/
-           prefix, pre_char, width, height, post_char = $1, $2, $3, $4, $5
-           self.thumb(:width =&gt; width, :height =&gt; height, :prefix =&gt; prefix, :special =&gt; [pre_char, post_char])
+        if default_thumbnail =~ /^(\w+)=([a-z])?(\d+)?x(\d+)?([%!&lt;&gt;@]?)$/
+          prefix, pre_char, width, height, post_char = $1, $2, $3, $4, $5
+          self.thumb(:width =&gt; width, :height =&gt; height, :prefix =&gt; prefix, :special =&gt; [pre_char, post_char])
         end
       end
     end
   end  
   
-protected    
+  protected
 
   def set_filename_as_name
     unless parent</diff>
      <filename>app/models/gallery_item.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>90ffbd2fe2673a442e19ce2329ee3034707d6d08</id>
    </parent>
  </parents>
  <author>
    <name>Edmund Haselwanter</name>
    <email>edmund@haselwanter.com</email>
  </author>
  <url>http://github.com/pilu/radiant-gallery/commit/9279236307e4802eda1ec70bfaee2c5edd5afac5</url>
  <id>9279236307e4802eda1ec70bfaee2c5edd5afac5</id>
  <committed-date>2009-10-15T15:39:53-07:00</committed-date>
  <authored-date>2009-08-29T03:56:01-07:00</authored-date>
  <message>added s3 store as config value</message>
  <tree>92ef505344c985eee932fffd8d7a9103149947c2</tree>
  <committer>
    <name>Tom Cowell</name>
    <email>tc@eightsquarestudio.com</email>
  </committer>
</commit>
