fixes #118: flash uploads are broken

This commit is contained in:
albert
2011-10-14 18:02:11 -04:00
parent a35ab779d3
commit ddd036ef97
27 changed files with 2805 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
div#c-post-flags {
li {
list-style-type: disc;
}
}

View File

@@ -123,13 +123,19 @@ class Upload < ActiveRecord::Base
def calculate_hash(source_path)
self.md5 = Digest::MD5.file(source_path).hexdigest
end
def is_image?
["jpg", "gif", "png"].include?(file_ext)
end
end
module ResizerMethods
def generate_resizes(source_path)
generate_resize_for(Danbooru.config.small_image_width, Danbooru.config.small_image_width, source_path, 85)
generate_resize_for(Danbooru.config.medium_image_width, nil, source_path)
generate_resize_for(Danbooru.config.large_image_width, nil, source_path)
if is_image?
generate_resize_for(Danbooru.config.small_image_width, Danbooru.config.small_image_width, source_path, 85)
generate_resize_for(Danbooru.config.medium_image_width, nil, source_path)
generate_resize_for(Danbooru.config.large_image_width, nil, source_path)
end
end
def generate_resize_for(width, height, source_path, quality = 90)

View File

@@ -1,4 +1,4 @@
<% content_tag(:object, :width => post.image_width, :height => post.image_height) do %>
<%= content_tag(:object, :width => post.image_width, :height => post.image_height) do %>
<%= tag :params, :name => "movie", :value => post.file_url %>
<%= tag :embed, :src => post.file_url, :width => post.image_width, :height => post.image_height, :allowScriptAccess => "never" %>
<% end %>