has_image 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/lib/has_image.rb +5 -0
- data/lib/has_image/storage.rb +4 -0
- data/test_rails/pic_test.rb +9 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/has_image.rb
CHANGED
@@ -207,6 +207,11 @@ module HasImage
|
|
207
207
|
storage.filesystem_path_for(self, thumbnail)
|
208
208
|
end
|
209
209
|
|
210
|
+
# Regenerates the thumbails from the main image.
|
211
|
+
def regenerate_thumbnails
|
212
|
+
storage.regenerate_thumbnails(id, has_image_file)
|
213
|
+
end
|
214
|
+
|
210
215
|
# Deletes the image from the storage.
|
211
216
|
def remove_images
|
212
217
|
return if has_image_file.blank?
|
data/lib/has_image/storage.rb
CHANGED
data/test_rails/pic_test.rb
CHANGED
@@ -47,6 +47,15 @@ class PicTest < Test::Unit::TestCase
|
|
47
47
|
assert @pic.save!
|
48
48
|
end
|
49
49
|
|
50
|
+
def test_regenerate_thumbnails
|
51
|
+
Pic.has_image_options = HasImage.default_options_for(Pic).merge(
|
52
|
+
:thumbnails => {:small => "100x100", :tiny => "16x16"})
|
53
|
+
@pic = Pic.new(:image_data => fixture_file_upload("/image.jpg", "image/jpeg"))
|
54
|
+
@pic.save!
|
55
|
+
assert @pic.regenerate_thumbnails
|
56
|
+
end
|
57
|
+
|
58
|
+
|
50
59
|
def test_create_model_without_setting_image_data
|
51
60
|
assert Pic.new.save!
|
52
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Norman Clarke
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08-
|
12
|
+
date: 2008-08-28 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|