image_server 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/image_server/active_record.rb +6 -2
- data/lib/image_server/uploader.rb +1 -2
- data/lib/image_server/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa5a91e0a600999e6d1e01b7b504f8ea0a9edffd
|
4
|
+
data.tar.gz: 7be9fbc41bde26fe3af5bedfce7b348e73c39d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c25467774fa0e74d476755166e32b761d8be31e00a005c1e5f989eb4d89155688b91397d2ae0fc1c33b2c208810c5b7ffb4d72d2acc7489b86be847021cf1854
|
7
|
+
data.tar.gz: ba9e7fd9ef2c53e314ca6a36c526a572dd5e8466dbaafaaf58b6b73fd586f8027b7684e3b83fd67358368d43d63d088081a7474a1844f79c79e905b5c9cc5472
|
@@ -22,12 +22,16 @@ module ImageServer
|
|
22
22
|
#{processing_versions_constant} = #{processing_versions}
|
23
23
|
#{sharded_cdn_template_constant} = #{sharded_cdn_template}
|
24
24
|
|
25
|
-
def
|
26
|
-
uploader = ImageServer::Uploader.new(#{namespace_constant},
|
25
|
+
def #{column}=(source)
|
26
|
+
uploader = ImageServer::Uploader.new(#{namespace_constant}, source, #{outputs_constant})
|
27
27
|
image_property = uploader.upload
|
28
28
|
self.#{column}_hash = image_property.image_hash
|
29
29
|
end
|
30
30
|
|
31
|
+
def remote_#{column}_url=(url)
|
32
|
+
self.#{column} = url
|
33
|
+
end
|
34
|
+
|
31
35
|
def #{column}(options={})
|
32
36
|
default_options = { protocol: #{column}_cdn_protocol,
|
33
37
|
domain: #{column}_cdn_domain,
|
@@ -30,11 +30,10 @@ module ImageServer
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def find_or_create_image_property(properties)
|
33
|
-
return unless url
|
34
33
|
attributes = {
|
35
34
|
width: properties['width'],
|
36
35
|
height: properties['height'],
|
37
|
-
image_url: url.downcase,
|
36
|
+
image_url: (url.downcase if url),
|
38
37
|
namespace: @namespace
|
39
38
|
}
|
40
39
|
ip = ImageProperty.where(image_hash: properties['hash'], namespace: @namespace).first || ImageProperty.new(image_hash: properties['hash'])
|
data/lib/image_server/version.rb
CHANGED