carrierwave_imagevoodoo 0.0.8-java → 0.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b8e5a75e1b5c3586616f8be92c6fa5ce4d5bee7
4
- data.tar.gz: 3bbec9686b8098d55d7c6b1c0bfc5b67fb45e99f
3
+ metadata.gz: 16dcb397920759e5b4b63dd3132919f16e3e1bc8
4
+ data.tar.gz: e6c8e67e65202f97434d8f8643dda72fd94692c0
5
5
  SHA512:
6
- metadata.gz: e6d75623b666f1f01faca4d4a91010eee42c93d2aa88a98e107afabf41908474cdb3e109f1e854daa3084250d4f0be29e3df0d236cd668017669b378293e721a
7
- data.tar.gz: bdea5ac4db56967af23796e67ddb3bf58ff39cd97c7e43c2e1892a4e9aff8982b25117cc0fc4a75caf21f7711255842643edda070662ca5fadcac5e73e283757
6
+ metadata.gz: 94b14970ed1c2eaf0024265f8179478c51a1f0bfa21206e2b4ad5cd6095589e8d644b0e87041113e5a65ec39d12e73f3a259b102aaa0ecefee9fb81c05c81f7b
7
+ data.tar.gz: 1b099769e24093a5f36ec84ca1fd74a0cb29ed93165adb882efa5eef8cf86f3aea32cd773eccc6a5354a7e6528d0ef26fa4f54f1680f8d3da5c35f59eb470f42
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["taz@zenapsis.com"]
7
7
  gem.description = "CarrierWave support for ImageVoodoo"
8
8
  gem.summary = "A simple CarrierWave processor utilizing ImageVoodoo for processing"
9
- gem.homepage = "https://github.com/zenapsis/carrierwave_imagevoodoo"
9
+ gem.homepage = "https://github.com/tazsingh/carrierwave_imagevoodoo"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,4 +1,15 @@
1
1
  require "carrierwave"
2
+ %w[
3
+ common-lang
4
+ common-io
5
+ common-image
6
+ imageio-core
7
+ imageio-metadata
8
+ imageio-jpeg
9
+ imageio-tiff
10
+ ].each do |dep|
11
+ require File.expand_path("../../jars/twelvemonkeys-#{dep}-3.0-SNAPSHOT.jar", __FILE__)
12
+ end
2
13
  require "image_voodoo"
3
14
  require "active_support/concern"
4
15
 
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module ImageVoodoo
3
- VERSION = "0.0.8"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -11,78 +11,99 @@ describe CarrierWave::ImageVoodoo do
11
11
  klass.new
12
12
  end
13
13
 
14
- before do
15
- FileUtils.cp(file_path("cat.jpg"), file_path("cat_copy.jpg"))
16
- subject.stub(:file).and_return(CarrierWave::SanitizedFile.new(file_path("cat_copy.jpg")))
17
- subject.stub(:current_path).and_return(file_path("cat_copy.jpg"))
18
- subject.stub(:cached?).and_return true
19
- end
14
+ shared_examples_for :image_actions do
15
+ describe "#resize_to_fit" do
16
+ context "image is larger than dimensions" do
17
+ before { subject.resize_to_fit(200, 200) }
20
18
 
21
- after do
22
- FileUtils.rm(file_path("cat_copy.jpg"))
23
- end
19
+ it { should have_dimensions(127, 200) }
20
+ end
24
21
 
25
- describe "#resize_to_fit" do
26
- context "image is larger than dimensions" do
27
- before { subject.resize_to_fit(200, 200) }
22
+ context "image's largest side matches dimensions" do
23
+ before { subject.resize_to_fit(1000, 1000) }
28
24
 
29
- it { should have_dimensions(127, 200) }
30
- end
25
+ it { should have_dimensions(635, 1000) }
26
+ end
31
27
 
32
- context "image's largest side matches dimensions" do
33
- before { subject.resize_to_fit(1000, 1000) }
28
+ context "image is upscaled if smaller than dimensions" do
29
+ before { subject.resize_to_fit(2000, 2000) }
34
30
 
35
- it { should have_dimensions(635, 1000) }
31
+ it { should have_dimensions(1270, 2000) }
32
+ end
36
33
  end
37
34
 
38
- context "image is upscaled if smaller than dimensions" do
39
- before { subject.resize_to_fit(2000, 2000) }
35
+ describe '#resize_to_fill' do
36
+ context "image is exactly the same dimensions" do
37
+ before { subject.resize_to_fill(200, 200) }
40
38
 
41
- it { should have_dimensions(1270, 2000) }
42
- end
43
- end
39
+ it { should have_dimensions(200, 200) }
40
+ end
44
41
 
45
- describe '#resize_to_fill' do
46
- context "image is exactly the same dimensions" do
47
- before { subject.resize_to_fill(200, 200) }
42
+ context "image is scaled up if smaller than dimensions" do
43
+ before { subject.resize_to_fill(1000, 1000) }
48
44
 
49
- it { should have_dimensions(200, 200) }
45
+ it { should have_dimensions(1000, 1000) }
46
+ end
50
47
  end
51
48
 
52
- context "image is scaled up if smaller than dimensions" do
53
- before { subject.resize_to_fill(1000, 1000) }
49
+ describe '#resize_to_limit' do
50
+ context "image fits within height constraints" do
51
+ before { subject.resize_to_limit(700, 200) }
54
52
 
55
- it { should have_dimensions(1000, 1000) }
56
- end
57
- end
53
+ it { should have_dimensions(127, 200) }
54
+ end
58
55
 
59
- describe '#resize_to_limit' do
60
- context "image fits within height constraints" do
61
- before { subject.resize_to_limit(700, 200) }
56
+ context "image fits within width constraints" do
57
+ before { subject.resize_to_limit(127, 2000) }
62
58
 
63
- it { should have_dimensions(127, 200) }
64
- end
59
+ it { should have_dimensions(127, 200) }
60
+ end
65
61
 
66
- context "image fits within width constraints" do
67
- before { subject.resize_to_limit(127, 2000) }
62
+ context "image does not scale up if smaller than dimensions" do
63
+ before { subject.resize_to_limit(2000, 2000) }
68
64
 
69
- it { should have_dimensions(127, 200) }
65
+ it { should have_dimensions(635, 1000) }
66
+ end
70
67
  end
71
68
 
72
- context "image does not scale up if smaller than dimensions" do
73
- before { subject.resize_to_limit(2000, 2000) }
69
+ describe "#dimensions" do
70
+ its(:dimensions) { should == [635, 1000] }
74
71
 
75
- it { should have_dimensions(635, 1000) }
72
+ context "after processing" do
73
+ before { subject.resize_to_limit(127, 2000) }
74
+
75
+ its(:dimensions) { should == [127, 200] }
76
+ end
76
77
  end
77
78
  end
78
79
 
79
- describe "#dimensions" do
80
- its(:dimensions) { should == [635, 1000] }
80
+ context "RGB images" do
81
+ before do
82
+ FileUtils.cp(file_path("cat.jpg"), file_path("cat_copy.jpg"))
83
+ subject.stub(:file).and_return(CarrierWave::SanitizedFile.new(file_path("cat_copy.jpg")))
84
+ subject.stub(:current_path).and_return(file_path("cat_copy.jpg"))
85
+ subject.stub(:cached?).and_return true
86
+ end
87
+
88
+ after do
89
+ FileUtils.rm(file_path("cat_copy.jpg"))
90
+ end
91
+
92
+ it_should_behave_like :image_actions
93
+ end
81
94
 
82
- context "after processing" do
83
- before { subject.resize_to_limit(127, 2000) }
95
+ context "CMYK images" do
96
+ before do
97
+ FileUtils.cp(file_path("cat_cmyk.jpg"), file_path("cat_cmyk_copy.jpg"))
98
+ subject.stub(:file).and_return(CarrierWave::SanitizedFile.new(file_path("cat_cmyk_copy.jpg")))
99
+ subject.stub(:current_path).and_return(file_path("cat_cmyk_copy.jpg"))
100
+ subject.stub(:cached?).and_return true
101
+ end
84
102
 
85
- its(:dimensions) { should == [127, 200] }
103
+ after do
104
+ FileUtils.rm(file_path("cat_cmyk_copy.jpg"))
86
105
  end
106
+
107
+ it_should_behave_like :image_actions
87
108
  end
88
109
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_imagevoodoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: java
6
6
  authors:
7
7
  - Tasveer Singh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -95,12 +95,20 @@ files:
95
95
  - benchmarks/images/cat.jpg
96
96
  - benchmarks/minimagick_vs_imagevoodoo.rb
97
97
  - carrierwave_imagevoodoo.gemspec
98
+ - jars/twelvemonkeys-common-image-3.0-SNAPSHOT.jar
99
+ - jars/twelvemonkeys-common-io-3.0-SNAPSHOT.jar
100
+ - jars/twelvemonkeys-common-lang-3.0-SNAPSHOT.jar
101
+ - jars/twelvemonkeys-imageio-core-3.0-SNAPSHOT.jar
102
+ - jars/twelvemonkeys-imageio-jpeg-3.0-SNAPSHOT.jar
103
+ - jars/twelvemonkeys-imageio-metadata-3.0-SNAPSHOT.jar
104
+ - jars/twelvemonkeys-imageio-tiff-3.0-SNAPSHOT.jar
98
105
  - lib/carrierwave_imagevoodoo.rb
99
106
  - lib/carrierwave_imagevoodoo/version.rb
100
107
  - spec/carrierwave_imagevoodoo_spec.rb
101
108
  - spec/fixtures/cat.jpg
109
+ - spec/fixtures/cat_cmyk.jpg
102
110
  - spec/spec_helper.rb
103
- homepage: https://github.com/zenapsis/carrierwave_imagevoodoo
111
+ homepage: https://github.com/tazsingh/carrierwave_imagevoodoo
104
112
  licenses: []
105
113
  metadata: {}
106
114
  post_install_message:
@@ -126,4 +134,5 @@ summary: A simple CarrierWave processor utilizing ImageVoodoo for processing
126
134
  test_files:
127
135
  - spec/carrierwave_imagevoodoo_spec.rb
128
136
  - spec/fixtures/cat.jpg
137
+ - spec/fixtures/cat_cmyk.jpg
129
138
  - spec/spec_helper.rb