fixes #1847
This commit is contained in:
13
script/fixes/016_fix_swf_dimensions.rb
Normal file
13
script/fixes/016_fix_swf_dimensions.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
||||
|
||||
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
||||
|
||||
Post.where(:file_ext => "swf").find_each do |post|
|
||||
image_spec = ImageSpec.new(post.file_path)
|
||||
post.image_width = image_spec.width
|
||||
post.image_height = image_spec.height
|
||||
post.update_column(:image_width, post.image_width)
|
||||
post.update_column(:image_height, post.image_height)
|
||||
end
|
||||
Reference in New Issue
Block a user