cloudinary 1.0.73 → 1.0.74

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmFlNDk5YjhhMmM0MmE0YTFhM2Y1MDVkMjAyOGYyMDc5ZDhmZWM4OA==
4
+ NTc2ZWFlMjIyNmUyOGY1ZjIxNzAzNGVkZGU1NTQ2OTdiYTVjZTM2Yg==
5
5
  data.tar.gz: !binary |-
6
- OTNlOTg2MTRkNzVkNTc5M2FiNWQwMmU0NTQyMDc4Yzc0OTQ0NjE3MQ==
6
+ Zjc2ZjRjNjk2YjUyYWVkOWI3YmM2MDFjOGE5ZGM5NTg4MDhkNmZlMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjdlMTRkOWNiNDQ2ZWE5NTJkZDc0ZmQwMTE0MGIyMjcxZTAzMTNjYjA5Mjhl
10
- Mzk1NTdmNzI0ODg1OGM5YzUzNzNhOThiYTQ5ZDNjYmRlZWQwZTQwYTlkMzE0
11
- YTRhMmI0MDFlMzc2NjI3OWQ5ZWVkMTlkZjRiZWM3ZDNhNTAwZDM=
9
+ NDNjNTU4ODkxNjA1NTg5YTc0ZDYwY2MxNDE4MjUyNWNkM2Y3NzZhNGZiNGZm
10
+ YTVmZGRjYjlkYTI5NTAxODhhM2E0ZmE4ODI1MmU0MDYzNDc2NDUwZTljODk1
11
+ NjMzM2QzYzM1ZjQ5YjJhN2M5YzBhZmE2OGJkZDMyOTRkZDVkYzY=
12
12
  data.tar.gz: !binary |-
13
- ZmEwZGU0NzU3MTg2MWM4MWEwMDlmNTFmZTUxNDMzOWRhNTkxN2Q1YTE0YzNj
14
- YTAxYzBiNDA2ZjQ4OTVkYjY1NTViNWE1YWZjYzM0N2NhMWQyZWEwZGUwMDY1
15
- NGVkNjMyNTFhNWQ3ZDFkYjg2M2ZkNzJlNWMzNTk0MzM1Yzk0Yjg=
13
+ NWMzYzU2YzdmYTM4MjExYTdkNWNjYTMyM2FlMmExNWYxYWQ5NTI0ZGM3NTVi
14
+ NTI3YzE5ZDM4MzAzMmVmOTA2Yzg1NDNlYzBlYjczYmZlNjAyNzUwNGEwZmVk
15
+ MmYyODU0OTEwYTYwYTlmOTc0NDljY2IyMGQ5MGNmMmQ1Nzg4Nzk=
data/CHANGELOG CHANGED
@@ -1,3 +1,12 @@
1
+ = Version 1.0.74 - 2014-07-14
2
+ * Support custom_coordinates in upload and update. Support coordinates in resource details.
3
+ * Support delete_by_token for direct uploads.
4
+ * Support shorthand blank for cl_image_tag with responsive/hidpi.
5
+ * Correctly encode one-level double arrays.
6
+ * Support non-upload resources in signed_preloaded_image (Issue #117).
7
+ * Support background removal upload and admin API parameter.
8
+ * Update Cloudinary's jQuery plugin to v1.0.19.
9
+
1
10
  = Version 1.0.73 - 2014-06-30
2
11
  * Support dpr transformation parameter.
3
12
  * Support automatic dpr (for HiDPI) and automatic width (for responsive).
@@ -62,7 +62,7 @@ class Cloudinary::Api
62
62
  resource_type = options[:resource_type] || "image"
63
63
  type = options[:type] || "upload"
64
64
  uri = "resources/#{resource_type}/#{type}/#{public_id}"
65
- call_api(:get, uri, only(options, :colors, :exif, :faces, :image_metadata, :pages, :phash, :max_results), options)
65
+ call_api(:get, uri, only(options, :colors, :exif, :faces, :image_metadata, :pages, :phash, :coordinates, :max_results), options)
66
66
  end
67
67
 
68
68
  def self.update(public_id, options={})
@@ -73,12 +73,14 @@ class Cloudinary::Api
73
73
  :tags => options[:tags] && Cloudinary::Utils.build_array(options[:tags]).join(","),
74
74
  :context => Cloudinary::Utils.encode_hash(options[:context]),
75
75
  :face_coordinates => Cloudinary::Utils.encode_double_array(options[:face_coordinates]),
76
+ :custom_coordinates => Cloudinary::Utils.encode_double_array(options[:custom_coordinates]),
76
77
  :moderation_status => options[:moderation_status],
77
78
  :raw_convert => options[:raw_convert],
78
79
  :ocr => options[:ocr],
79
80
  :categorization => options[:categorization],
80
81
  :detection => options[:detection],
81
82
  :similarity_search => options[:similarity_search],
83
+ :background_removal => options[:background_removal],
82
84
  :auto_tagging => options[:auto_tagging] && options[:auto_tagging].to_f
83
85
  }
84
86
  call_api(:post, uri, update_options, options)
@@ -38,6 +38,7 @@ module CloudinaryHelper
38
38
  options["data-src"] = source
39
39
  extra_class = responsive ? "cld-responsive" : "cld-hidpi"
40
40
  options[:class] = [options[:class], extra_class].compact.join(" ")
41
+ responsive_placeholder = CL_BLANK if responsive_placeholder == "blank"
41
42
  source = responsive_placeholder
42
43
  end
43
44
  if source
@@ -46,15 +46,19 @@ class Cloudinary::Uploader
46
46
  :tags=>options[:tags] && Cloudinary::Utils.build_array(options[:tags]).join(","),
47
47
  :context => Cloudinary::Utils.encode_hash(options[:context]),
48
48
  :face_coordinates => Cloudinary::Utils.encode_double_array(options[:face_coordinates]),
49
+ :custom_coordinates => Cloudinary::Utils.encode_double_array(options[:custom_coordinates]),
49
50
  :moderation => options[:moderation],
50
51
  :raw_convert => options[:raw_convert],
51
52
  :ocr => options[:ocr],
52
53
  :categorization => options[:categorization],
53
54
  :detection => options[:detection],
54
55
  :similarity_search => options[:similarity_search],
56
+ :background_removal => options[:background_removal],
55
57
  :auto_tagging => options[:auto_tagging] && options[:auto_tagging].to_f,
56
58
  :upload_preset => options[:upload_preset],
57
- :phash => Cloudinary::Utils.as_safe_bool(options[:phash])}
59
+ :phash => Cloudinary::Utils.as_safe_bool(options[:phash]),
60
+ :return_delete_token => Cloudinary::Utils.as_safe_bool(options[:return_delete_token]),
61
+ }
58
62
  params
59
63
  end
60
64
 
@@ -268,7 +268,7 @@ class Cloudinary::Utils
268
268
  end
269
269
 
270
270
  def self.signed_preloaded_image(result)
271
- "#{result["resource_type"]}/upload/v#{result["version"]}/#{[result["public_id"], result["format"]].reject(&:blank?).join(".")}##{result["signature"]}"
271
+ "#{result["resource_type"]}/#{result["type"] || "upload"}/v#{result["version"]}/#{[result["public_id"], result["format"]].reject(&:blank?).join(".")}##{result["signature"]}"
272
272
  end
273
273
 
274
274
  @@json_decode = false
@@ -305,7 +305,12 @@ class Cloudinary::Utils
305
305
  end
306
306
 
307
307
  def self.encode_double_array(array)
308
- build_array(array).map{|a| build_array(a).join(",")}.join("|")
308
+ array = build_array(array)
309
+ if array.length > 0 && array[0].is_a?(Array)
310
+ return array.map{|a| build_array(a).join(",")}.join("|")
311
+ else
312
+ return array.join(",")
313
+ end
309
314
  end
310
315
 
311
316
  IMAGE_FORMATS = %w(bmp png tif tiff jpg jpeg gif pdf ico eps jpc jp2 psd)
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "1.0.73"
3
+ VERSION = "1.0.74"
4
4
  end
@@ -477,4 +477,9 @@ describe Cloudinary::Utils do
477
477
  options.should == {responsive: true}
478
478
  result.should == "http://res.cloudinary.com/test123/image/upload/c_crop,h_100,w_100/c_pad,w_auto/test"
479
479
  end
480
+
481
+ it "should correctly encode double arrays" do
482
+ Cloudinary::Utils.encode_double_array([1,2,3,4]).should == "1,2,3,4"
483
+ Cloudinary::Utils.encode_double_array([[1,2,3,4],[5,6,7,8]]).should == "1,2,3,4|5,6,7,8"
484
+ end
480
485
  end
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.73
4
+ version: 1.0.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nadav Soferman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-06-30 00:00:00.000000000 Z
13
+ date: 2014-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client