bcms_thumbnail 1.0.1 → 1.0.2
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 -3
- metadata +3 -3
@@ -6,10 +6,10 @@ module ActionView
|
|
6
6
|
|
7
7
|
def thumbnail(attachment_obj,geometry = '100x100')
|
8
8
|
if ! attachment_obj.blank? && attachment_obj.respond_to?('attachment') && ['jpg','png','gif','bmp'].include?(attachment_obj.attachment.file_extension.downcase)
|
9
|
-
thumbnail_location = "/bcms_thumbnail_cache/#{attachment_obj.attachment.file_location.gsub(/[\\\/]/,'-')}
|
9
|
+
thumbnail_location = "/bcms_thumbnail_cache/#{geometry}/#{attachment_obj.attachment.file_location.gsub(/[\\\/]/,'-')}.jpg"
|
10
10
|
if ! File.exists?("#{RAILS_ROOT}/public#{thumbnail_location}")
|
11
|
-
if ! File.exists?("#{RAILS_ROOT}/public/bcms_thumbnail_cache
|
12
|
-
FileUtils.mkdir_p("#{RAILS_ROOT}/public/bcms_thumbnail_cache
|
11
|
+
if ! File.exists?("#{RAILS_ROOT}/public/bcms_thumbnail_cache/#{geometry}")
|
12
|
+
FileUtils.mkdir_p("#{RAILS_ROOT}/public/bcms_thumbnail_cache/#{geometry}")
|
13
13
|
end
|
14
14
|
image = MiniMagick::Image.from_file("#{RAILS_ROOT}/tmp/uploads/#{attachment_obj.attachment.file_location}")
|
15
15
|
image.resize geometry
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Dan Collis-Puro
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-25 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|