cloudinary 1.0.80 → 1.0.81
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/lib/cloudinary/carrier_wave.rb +6 -2
- data/lib/cloudinary/carrier_wave/process.rb +9 -5
- data/lib/cloudinary/carrier_wave/storage.rb +0 -1
- data/lib/cloudinary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22f7163efe3beefab6b2653a0c3e440f45907eee
|
4
|
+
data.tar.gz: 4a446807c4be6d7769384adebc9a2b08fe910d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70ea68172f8e246e74049e87ce49e49af856dc7428fdc68b635a3fa6f886c32c656fe625fa31051665da3c2037e7bac85f17e710d973bdbcb586e9969235b433
|
7
|
+
data.tar.gz: 3663bde9f91c9d51b6760e1383f200d731425c63aad59520b508f6cd333f4793875bd79a361e5f1be126a65291c57833539054302fc6991cc56be6275a391109
|
data/CHANGELOG
CHANGED
@@ -60,7 +60,7 @@ module Cloudinary::CarrierWave
|
|
60
60
|
|
61
61
|
def filename
|
62
62
|
return nil if self.blank?
|
63
|
-
return [self.full_public_id, self.format].join(".")
|
63
|
+
return [self.full_public_id, self.format].reject(&:blank?).join(".")
|
64
64
|
end
|
65
65
|
|
66
66
|
# default public_id to use if no uploaded file. Override with public_id of an uploaded image if you want a default image.
|
@@ -176,8 +176,12 @@ module Cloudinary::CarrierWave
|
|
176
176
|
return Cloudinary::PreloadedFile.split_format(identifier)
|
177
177
|
end
|
178
178
|
|
179
|
+
def default_format
|
180
|
+
"png"
|
181
|
+
end
|
182
|
+
|
179
183
|
def resource_type
|
180
|
-
Cloudinary::Utils.resource_type_for_format(
|
184
|
+
Cloudinary::Utils.resource_type_for_format(requested_format || original_filename || default_format)
|
181
185
|
end
|
182
186
|
|
183
187
|
# For the given methods - versions should call the main uploader method
|
@@ -135,7 +135,7 @@ module Cloudinary::CarrierWave
|
|
135
135
|
@tags
|
136
136
|
end
|
137
137
|
|
138
|
-
def
|
138
|
+
def requested_format
|
139
139
|
format_processor = self.all_processors.find{|processor| processor[0] == :convert}
|
140
140
|
if format_processor
|
141
141
|
# Explicit format is given
|
@@ -146,11 +146,15 @@ module Cloudinary::CarrierWave
|
|
146
146
|
# No local format. The reset should be handled by main uploader
|
147
147
|
uploader = self.model.send(self.mounted_as)
|
148
148
|
format = uploader.format
|
149
|
-
else
|
150
|
-
# Try to auto-detect format
|
151
|
-
format = Cloudinary::PreloadedFile.split_format(original_filename || "").last
|
152
|
-
format ||= "png" # TODO Default format?
|
153
149
|
end
|
150
|
+
format
|
151
|
+
end
|
152
|
+
|
153
|
+
def format
|
154
|
+
format = Cloudinary::PreloadedFile.split_format(original_filename || "").last
|
155
|
+
return format || "" if resource_type == "raw"
|
156
|
+
format = requested_format || format || default_format
|
157
|
+
|
154
158
|
format = format.to_s.downcase
|
155
159
|
Cloudinary::FORMAT_ALIASES[format] || format
|
156
160
|
end
|
@@ -35,7 +35,6 @@ class Cloudinary::CarrierWave::Storage < ::CarrierWave::Storage::Abstract
|
|
35
35
|
params[:type]=uploader.class.storage_type
|
36
36
|
|
37
37
|
params[:resource_type] ||= :auto
|
38
|
-
|
39
38
|
uploader.metadata = Cloudinary::Uploader.upload(data, params)
|
40
39
|
if uploader.metadata["error"]
|
41
40
|
raise Cloudinary::CarrierWave::UploadError.new(uploader.metadata["error"]["message"], uploader.metadata["error"]["http_code"])
|
data/lib/cloudinary/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.81
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nadav Soferman
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2015-01-
|
14
|
+
date: 2015-01-08 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|