httpimagestore 1.2.0 → 1.3.0
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/Gemfile +5 -2
- data/Gemfile.lock +24 -14
- data/README.md +161 -105
- data/bin/httpimagestore +6 -2
- data/features/cache-control.feature +2 -2
- data/features/compatibility.feature +4 -4
- data/features/error-reporting.feature +49 -3
- data/features/flexi.feature +260 -0
- data/features/s3-store-and-thumbnail.feature +1 -1
- data/features/step_definitions/httpimagestore_steps.rb +24 -0
- data/features/storage.feature +199 -0
- data/features/support/test-large.jpg +0 -0
- data/features/support/test.png +0 -0
- data/httpimagestore.gemspec +13 -9
- data/lib/httpimagestore/configuration/file.rb +1 -1
- data/lib/httpimagestore/configuration/handler.rb +114 -20
- data/lib/httpimagestore/configuration/identify.rb +56 -0
- data/lib/httpimagestore/configuration/path.rb +7 -28
- data/lib/httpimagestore/configuration/s3.rb +230 -12
- data/lib/httpimagestore/configuration/thumbnailer.rb +17 -8
- data/lib/httpimagestore/error_reporter.rb +1 -11
- data/load_test/load_test.jmx +11 -11
- data/load_test/thumbnail_specs.csv +11 -11
- data/spec/configuration_file_spec.rb +20 -20
- data/spec/configuration_handler_spec.rb +156 -6
- data/spec/configuration_identify_spec.rb +45 -0
- data/spec/configuration_output_spec.rb +15 -15
- data/spec/configuration_path_spec.rb +70 -23
- data/spec/configuration_s3_spec.rb +187 -28
- data/spec/configuration_thumbnailer_spec.rb +22 -22
- data/spec/spec_helper.rb +11 -2
- data/spec/support/full.cfg +4 -4
- metadata +12 -8
- data/features/facebook.feature +0 -149
data/spec/support/full.cfg
CHANGED
@@ -2,10 +2,10 @@ s3 key="AKIAJMUYVYOSACNXLPTQ" secret="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"
|
|
2
2
|
|
3
3
|
path {
|
4
4
|
"uri" "#{path}"
|
5
|
-
"hash" "#{
|
6
|
-
"hash-name" "#{
|
7
|
-
"structured" "#{dirname}/#{
|
8
|
-
"structured-name" "#{dirname}/#{
|
5
|
+
"hash" "#{input_digest}.#{image_mime_extension}"
|
6
|
+
"hash-name" "#{input_digest}/#{image_name}.#{image_mime_extension}"
|
7
|
+
"structured" "#{dirname}/#{input_digest}/#{basename}.#{image_mime_extension}"
|
8
|
+
"structured-name" "#{dirname}/#{input_digest}/#{basename}-#{image_name}.#{image_mime_extension}"
|
9
9
|
}
|
10
10
|
|
11
11
|
put "thumbnail" ":name_list" {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpimagestore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: unicorn-cuba-base
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
29
|
+
version: '1.1'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: httpthumbnailer-client
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: '1.
|
37
|
+
version: '1.1'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: '1.
|
45
|
+
version: '1.1'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: aws-sdk
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,20 +241,23 @@ files:
|
|
241
241
|
- features/cache-control.feature
|
242
242
|
- features/compatibility.feature
|
243
243
|
- features/error-reporting.feature
|
244
|
-
- features/
|
244
|
+
- features/flexi.feature
|
245
245
|
- features/health-check.feature
|
246
246
|
- features/s3-store-and-thumbnail.feature
|
247
247
|
- features/step_definitions/httpimagestore_steps.rb
|
248
|
+
- features/storage.feature
|
248
249
|
- features/support/env.rb
|
249
250
|
- features/support/test-large.jpg
|
250
251
|
- features/support/test.empty
|
251
252
|
- features/support/test.jpg
|
253
|
+
- features/support/test.png
|
252
254
|
- features/support/test.txt
|
253
255
|
- httpimagestore.gemspec
|
254
256
|
- lib/httpimagestore/aws_sdk_regions_hack.rb
|
255
257
|
- lib/httpimagestore/configuration.rb
|
256
258
|
- lib/httpimagestore/configuration/file.rb
|
257
259
|
- lib/httpimagestore/configuration/handler.rb
|
260
|
+
- lib/httpimagestore/configuration/identify.rb
|
258
261
|
- lib/httpimagestore/configuration/output.rb
|
259
262
|
- lib/httpimagestore/configuration/path.rb
|
260
263
|
- lib/httpimagestore/configuration/s3.rb
|
@@ -267,6 +270,7 @@ files:
|
|
267
270
|
- load_test/thumbnail_specs.csv
|
268
271
|
- spec/configuration_file_spec.rb
|
269
272
|
- spec/configuration_handler_spec.rb
|
273
|
+
- spec/configuration_identify_spec.rb
|
270
274
|
- spec/configuration_output_spec.rb
|
271
275
|
- spec/configuration_path_spec.rb
|
272
276
|
- spec/configuration_s3_spec.rb
|
@@ -292,7 +296,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
292
296
|
version: '0'
|
293
297
|
segments:
|
294
298
|
- 0
|
295
|
-
hash:
|
299
|
+
hash: 1883353100319806536
|
296
300
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
297
301
|
none: false
|
298
302
|
requirements:
|
data/features/facebook.feature
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
Feature: Store limited original image in S3 and thumbnail on facebook API
|
2
|
-
Similar API to described in https://developers.facebook.com/docs/reference/api/using-pictures/#sizes
|
3
|
-
|
4
|
-
Background:
|
5
|
-
Given S3 settings in AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_S3_TEST_BUCKET environment variables
|
6
|
-
Given httpthumbnailer server is running at http://localhost:3100/health_check
|
7
|
-
Given httpimagestore server is running at http://localhost:3000/health_check with the following configuration
|
8
|
-
"""
|
9
|
-
s3 key="@AWS_ACCESS_KEY_ID@" secret="@AWS_SECRET_ACCESS_KEY@" ssl=false
|
10
|
-
|
11
|
-
path "original-hash" "#{digest}"
|
12
|
-
path "path" "#{path}"
|
13
|
-
|
14
|
-
put "original" {
|
15
|
-
thumbnail "input" "original" operation="limit" width=100 height=100 format="jpeg" quality=95
|
16
|
-
|
17
|
-
store_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="original-hash"
|
18
|
-
|
19
|
-
output_store_path "original"
|
20
|
-
}
|
21
|
-
|
22
|
-
get "&type=square" {
|
23
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
24
|
-
|
25
|
-
thumbnail "original" "thumbnail" operation="crop" width="50" height="50" format="input"
|
26
|
-
|
27
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
28
|
-
}
|
29
|
-
|
30
|
-
get "&type=small" {
|
31
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
32
|
-
|
33
|
-
thumbnail "original" "thumbnail" operation="fit" width="50" height="2000" format="input"
|
34
|
-
|
35
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
36
|
-
}
|
37
|
-
|
38
|
-
get "&type=normall" {
|
39
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
40
|
-
|
41
|
-
thumbnail "original" "thumbnail" operation="fit" width="100" height="2000" format="input"
|
42
|
-
|
43
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
44
|
-
}
|
45
|
-
|
46
|
-
get "&type=large" {
|
47
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
48
|
-
|
49
|
-
thumbnail "original" "thumbnail" operation="fit" width="200" height="2000" format="input"
|
50
|
-
|
51
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
52
|
-
}
|
53
|
-
|
54
|
-
get "&:width" "&:height" {
|
55
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
56
|
-
|
57
|
-
thumbnail "original" "thumbnail" operation="crop" width="#{width}" height="#{height}" format="input"
|
58
|
-
|
59
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
60
|
-
}
|
61
|
-
|
62
|
-
get "&:width" "&:height?1080" {
|
63
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
64
|
-
|
65
|
-
thumbnail "original" "thumbnail" operation="fit" width="#{width}" height="#{height}" format="input"
|
66
|
-
|
67
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
68
|
-
}
|
69
|
-
|
70
|
-
get {
|
71
|
-
source_s3 "original" bucket="@AWS_S3_TEST_BUCKET@" path="path"
|
72
|
-
|
73
|
-
thumbnail "original" "thumbnail" operation="crop" width="50" height="50" format="input"
|
74
|
-
|
75
|
-
output_image "thumbnail" cache-control="public, max-age=31557600, s-maxage=0"
|
76
|
-
}
|
77
|
-
"""
|
78
|
-
|
79
|
-
@facebook @type
|
80
|
-
Scenario: Putting original to S3 bucket
|
81
|
-
Given there is no 4006450256177f4a file in S3 bucket
|
82
|
-
Given test.jpg file content as request body
|
83
|
-
When I do PUT request http://localhost:3000/original
|
84
|
-
Then response status will be 200
|
85
|
-
And response content type will be text/plain
|
86
|
-
And response body will be CRLF ended lines
|
87
|
-
"""
|
88
|
-
4006450256177f4a
|
89
|
-
"""
|
90
|
-
Then S3 object 4006450256177f4a will contain JPEG image of size 71x100
|
91
|
-
When I do GET request http://@AWS_S3_TEST_BUCKET@.s3.amazonaws.com/4006450256177f4a
|
92
|
-
Then response status will be 403
|
93
|
-
|
94
|
-
@facebook @type
|
95
|
-
Scenario: Getting square type tumbnail
|
96
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
97
|
-
When I do GET request http://localhost:3000/4006450256177f4a?type=square
|
98
|
-
Then response status will be 200
|
99
|
-
And response content type will be image/jpeg
|
100
|
-
Then response body will contain JPEG image of size 50x50
|
101
|
-
|
102
|
-
@facebook @type
|
103
|
-
Scenario: Getting small type tumbnail
|
104
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
105
|
-
When I do GET request http://localhost:3000/4006450256177f4a?type=small
|
106
|
-
Then response status will be 200
|
107
|
-
And response content type will be image/jpeg
|
108
|
-
Then response body will contain JPEG image of size 50x71
|
109
|
-
|
110
|
-
@facebook @type
|
111
|
-
Scenario: Getting normall type tumbnail
|
112
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
113
|
-
When I do GET request http://localhost:3000/4006450256177f4a?type=normall
|
114
|
-
Then response status will be 200
|
115
|
-
And response content type will be image/jpeg
|
116
|
-
Then response body will contain JPEG image of size 100x141
|
117
|
-
|
118
|
-
@facebook @type
|
119
|
-
Scenario: Getting large type tumbnail
|
120
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
121
|
-
When I do GET request http://localhost:3000/4006450256177f4a?type=large
|
122
|
-
Then response status will be 200
|
123
|
-
And response content type will be image/jpeg
|
124
|
-
Then response body will contain JPEG image of size 200x283
|
125
|
-
|
126
|
-
@facebook @type
|
127
|
-
Scenario: Getting square type tumbnail when no type is specified
|
128
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
129
|
-
When I do GET request http://localhost:3000/4006450256177f4a
|
130
|
-
Then response status will be 200
|
131
|
-
And response content type will be image/jpeg
|
132
|
-
Then response body will contain JPEG image of size 50x50
|
133
|
-
|
134
|
-
@facebook @size
|
135
|
-
Scenario: Getting custom size tumbnail
|
136
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
137
|
-
When I do GET request http://localhost:3000/4006450256177f4a?width=123&height=321
|
138
|
-
Then response status will be 200
|
139
|
-
And response content type will be image/jpeg
|
140
|
-
Then response body will contain JPEG image of size 123x321
|
141
|
-
|
142
|
-
@facebook @size
|
143
|
-
Scenario: Getting custom size tumbnail without height
|
144
|
-
Given test.jpg file content is stored in S3 under 4006450256177f4a
|
145
|
-
When I do GET request http://localhost:3000/4006450256177f4a?width=123
|
146
|
-
Then response status will be 200
|
147
|
-
And response content type will be image/jpeg
|
148
|
-
Then response body will contain JPEG image of size 123x174
|
149
|
-
|