bcms_thumbnail 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bcms_thumbnail/bcms_thumbnail.rb +3 -0
- metadata +2 -2
@@ -10,10 +10,13 @@ module ActionView
|
|
10
10
|
if ! File.exists?("#{RAILS_ROOT}/public#{thumbnail_location}")
|
11
11
|
if ! File.exists?("#{RAILS_ROOT}/public/bcms_thumbnail_cache/#{geometry}")
|
12
12
|
FileUtils.mkdir_p("#{RAILS_ROOT}/public/bcms_thumbnail_cache/#{geometry}")
|
13
|
+
FileUtils.chmod 0755, "#{RAILS_ROOT}/public/bcms_thumbnail_cache/"
|
14
|
+
FileUtils.chmod 0755, "#{RAILS_ROOT}/public/bcms_thumbnail_cache/#{geometry}"
|
13
15
|
end
|
14
16
|
image = MiniMagick::Image.from_file("#{RAILS_ROOT}/tmp/uploads/#{attachment_obj.attachment.file_location}")
|
15
17
|
image.resize geometry
|
16
18
|
image.write("#{RAILS_ROOT}/public#{thumbnail_location}")
|
19
|
+
FileUtils.chmod 0644, "#{RAILS_ROOT}/public#{thumbnail_location}"
|
17
20
|
URI::escape(thumbnail_location)
|
18
21
|
else
|
19
22
|
URI::escape(thumbnail_location)
|