debug info
This commit is contained in:
parent
aa30654071
commit
3f22d112c1
|
@ -78,14 +78,17 @@ class Photo < ActiveRecord::Base
|
||||||
# Thanks to bug in Flash 8 the content type is always set to application/octet-stream.
|
# Thanks to bug in Flash 8 the content type is always set to application/octet-stream.
|
||||||
# From: http://blog.airbladesoftware.com/2007/8/8/uploading-files-with-swfupload
|
# From: http://blog.airbladesoftware.com/2007/8/8/uploading-files-with-swfupload
|
||||||
def swf_uploaded_data=(data)
|
def swf_uploaded_data=(data)
|
||||||
|
RAILS_DEFAULT_LOGGER.info('swf_uploaded_data start')
|
||||||
data.content_type = MIME::Types.type_for(data.original_filename)
|
data.content_type = MIME::Types.type_for(data.original_filename)
|
||||||
self.title = data.original_filename
|
self.title = data.original_filename
|
||||||
self.path = self.album.path + "/" + data.original_filename
|
self.path = self.album.path + "/" + data.original_filename
|
||||||
File.open(APP_CONFIG[:photos_path] + self.path, "wb") { |f| f.write(data.read) }
|
File.open(APP_CONFIG[:photos_path] + self.path, "wb") { |f| f.write(data.read) }
|
||||||
|
RAILS_DEFAULT_LOGGER.info('swf_uploaded_data done')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def create_thumbnails
|
def create_thumbnails
|
||||||
|
RAILS_DEFAULT_LOGGER.info('create thumb')
|
||||||
ImageScience.with_image(APP_CONFIG[:photos_path] + self.path) do |img|
|
ImageScience.with_image(APP_CONFIG[:photos_path] + self.path) do |img|
|
||||||
img.cropped_thumbnail(200) do |thumb|
|
img.cropped_thumbnail(200) do |thumb|
|
||||||
thumb.save APP_CONFIG[:thumbs_path] + self.album.path + "/" + self.id.to_s + "_collection" + self.extension
|
thumb.save APP_CONFIG[:thumbs_path] + self.album.path + "/" + self.id.to_s + "_collection" + self.extension
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<% for collection in @collections %>
|
<% for collection in @collections %>
|
||||||
<div class="thumb">
|
<div class="thumb">
|
||||||
<h3><%= link_to collection.title, collection %></h3>
|
<h3><%= link_to collection.title, collection %></h3>
|
||||||
<%= render :partial => collection.albums.find(:first), :locals => {:photosize => 'collection'} %>
|
<%= link_to (image_tag collection.albums.find(:first).photos.first.path_modified_public('collection') ), collection_path(collection) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue