aspose_imaging_cloud 20.6 → 21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +67 -34
- data/lib/aspose-imaging-cloud.rb +1 -0
- data/lib/aspose-imaging-cloud/api/imaging_api.rb +11 -12
- data/lib/aspose-imaging-cloud/api_client.rb +5 -5
- data/lib/aspose-imaging-cloud/configuration.rb +6 -6
- data/lib/aspose-imaging-cloud/models/eps_properties.rb +241 -0
- data/lib/aspose-imaging-cloud/models/imaging_response.rb +11 -1
- data/lib/aspose-imaging-cloud/models/requests/get_available_labels_request.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec3f0699d508f669f4c675f387a598e4be64976bbc3f323a8945d09927a1af4a
|
4
|
+
data.tar.gz: ea32576f681294040397a4d29d88e127cffaffdb12d2cb5004f31c883d060b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 774e79c95e5efa15293e150db7a90b8ecfe9d8b6f581186e4bb4a5fb70532f6577a33b93e5ba8b350c4edd8c33d6302765a683f1adfd05f0b4478f544f120643
|
7
|
+
data.tar.gz: 7ef8c7a420a8f30a7bbab437ad22058d75ed05b57ead6d37eda20179ea5877930f43f90977d5684ebc26f04a9c6a164aa1675e218b220629f81ab4ec8b0879d2
|
data/README.md
CHANGED
@@ -1,8 +1,56 @@
|
|
1
|
-
|
1
|
+
![](https://img.shields.io/badge/api-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_imaging_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_words_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-imaging-cloud/aspose-imaging-cloud-ruby)](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-ruby/blob/master/LICENSE)
|
2
|
+
## Image Processing in Cloud via Ruby REST API
|
3
|
+
[Aspose.Imaging Cloud](https://products.aspose.cloud/imaging) is a true [REST API](https://apireference.aspose.cloud/imaging/) that enables you to perform a wide range of image processing operations including creation, manipulation and conversion in the cloud, with zero initial costs. Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process images in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights.
|
2
4
|
|
3
|
-
|
5
|
+
This repository contains [Aspose.Imaging Cloud Ruby SDK](https://products.aspose.cloud/imaging/ruby) source code. This SDK allows you to work with Aspose.Imaging Cloud REST APIs in your Python applications quickly and easily, with zero initial cost.
|
4
6
|
|
5
|
-
|
7
|
+
To use this SDK, you will need Client ID and Client secret which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (free registration in Aspose Cloud is required for this).
|
8
|
+
|
9
|
+
The solution is updated using [code generator](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-codegen).
|
10
|
+
## Image Processing Features
|
11
|
+
|
12
|
+
- Fetch or update properties of cloud-hosted images.
|
13
|
+
- Scale, flip, crop, and export an image with a single API call.
|
14
|
+
- Resize, crop, flip, convert, and export an image to other supported formats.
|
15
|
+
- Update image parameters of JPEG2000 & WEBP images.
|
16
|
+
- Access and multi-frame TIFF image and extract the desired frames from it.
|
17
|
+
- Rotate, flip, crop, resize, or fetch properties of the selected TIFF frame.
|
18
|
+
- Merge multiple TIFF images.
|
19
|
+
|
20
|
+
## Read & Write Image Formats
|
21
|
+
BMP, GIF, JPEG, JPEG2000, PSD, TIFF, WEBP, PNG, WMF, EMF, SVG
|
22
|
+
|
23
|
+
## Save Image As
|
24
|
+
PDF, DICOM
|
25
|
+
|
26
|
+
## Read Image Formats
|
27
|
+
DJVU, DICOM, CDR, CMX, ODG, DNG, EPS
|
28
|
+
|
29
|
+
## Enhancements in Version 20.12
|
30
|
+
|
31
|
+
- Enhanced the **EPS** file format inheritance to support rotate, resize, flip, etc. operations as vector images support.
|
32
|
+
- Improved image loading, conversion, and export features.
|
33
|
+
- Added the JavaScript SDK.
|
34
|
+
|
35
|
+
## Enhancements in Version 20.9
|
36
|
+
- Resumed the support of **Android SDK** and updated reference to Aspose.Imaging and Aspose.PSD.
|
37
|
+
|
38
|
+
|
39
|
+
## Enhancements in Version 20.10
|
40
|
+
|
41
|
+
- Support for additional image formats in Object Detection.
|
42
|
+
- Support to load and convert **EPS** files to **PDF/A** format.
|
43
|
+
|
44
|
+
## Storage API support
|
45
|
+
Since version 19.4, SDK includes support of storage operations for better user experience and unification, so now there's no need to use 2 different SDKs!
|
46
|
+
|
47
|
+
It gives you an ability to:
|
48
|
+
* Upload, download, copy, move and delete files, including versions handling (if you are using Cloud storage that supports this feature - true by default)
|
49
|
+
* Create, copy, move and delete folders
|
50
|
+
* Copy and move files and folders accross separate storages in scope of a single operation
|
51
|
+
* Check if certain file, folder or storage exists
|
52
|
+
|
53
|
+
Detalied official documentation can be found at the [following link](https://docs.aspose.cloud/imaging/).
|
6
54
|
|
7
55
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
56
|
|
@@ -31,7 +79,7 @@ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.or
|
|
31
79
|
|
32
80
|
Finally add this to the Gemfile:
|
33
81
|
|
34
|
-
gem 'aspose-imaging-cloud', '~>
|
82
|
+
gem 'aspose-imaging-cloud', '~> 21.2'
|
35
83
|
|
36
84
|
### Install from Git
|
37
85
|
|
@@ -47,38 +95,15 @@ Include the Ruby code directly using `-I` as follows:
|
|
47
95
|
ruby -Ilib script.rb
|
48
96
|
```
|
49
97
|
|
50
|
-
## Getting Started
|
51
|
-
|
52
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
53
|
-
```ruby
|
54
|
-
# Load the gem
|
55
|
-
require 'aspose-imaging-cloud'
|
56
|
-
|
57
|
-
# Setup authorization
|
58
|
-
AsposeImagingCloud.configure do |config|
|
59
|
-
# Configure OAuth2 access token for authorization: JWT
|
60
|
-
config.access_token = 'YOUR ACCESS TOKEN'
|
61
|
-
end
|
62
|
-
|
63
|
-
api_instance = AsposeImagingCloud::ImagingApi.new
|
64
98
|
|
65
|
-
|
99
|
+
## Convert PNG to JPG in Ruby
|
66
100
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
image_data: File.new('/path/to/file.txt'), # File | Input image
|
71
|
-
folder: 'folder_example', # String | Folder.
|
72
|
-
storage: 'storage_example' # String | Storage
|
73
|
-
}
|
74
|
-
|
75
|
-
begin
|
76
|
-
#Add image and images features to search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
|
77
|
-
api_instance.add_search_image(search_context_id, image_id, opts)
|
78
|
-
rescue AsposeImagingCloud::ApiError => e
|
79
|
-
puts "Exception when calling ImagingApi->add_search_image: #{e}"
|
80
|
-
end
|
101
|
+
```ruby
|
102
|
+
# Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).
|
103
|
+
api = AsposeImagingCloud::ImagingApi.new("MY_CLIENT_SECRET", "MY_CLIENT_ID")
|
81
104
|
|
105
|
+
requestParam = AsposeImagingCloud::ConvertImageRequest.new("sample.png", "jpg", "tempFolder", "My_Storage_Name")
|
106
|
+
result = api.convert_image(requestParam)
|
82
107
|
```
|
83
108
|
|
84
109
|
## Documentation for API Endpoints
|
@@ -231,6 +256,14 @@ Class | Method | HTTP request | Description
|
|
231
256
|
|
232
257
|
- **Type**: OAuth
|
233
258
|
- **Flow**: application
|
234
|
-
- **Authorization URL**:
|
259
|
+
- **Authorization URL**:
|
235
260
|
- **Scopes**: N/A
|
236
261
|
|
262
|
+
## Aspose.Imaging Cloud SDKs in Popular Languages
|
263
|
+
|
264
|
+
| .NET | Java | PHP | Python | Ruby | Node.js |Android|
|
265
|
+
|---|---|---|---|---|---|--|
|
266
|
+
| [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-dotnet) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-java) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-php) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-python) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-ruby) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-node) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-android) | [GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-swift)|[GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-dart) |[GitHub](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-go) |
|
267
|
+
| [NuGet](https://www.nuget.org/packages/Aspose.Imaging-Cloud/) | [Maven](https://repository.aspose.cloud/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-imaging-cloud) | [Composer](https://packagist.org/packages/aspose/aspose-imaging-cloud) | [PIP](https://pypi.org/project/aspose.imaging-cloud/) | [GEM](https://rubygems.org/gems/aspose_imaging_cloud) | [NPM](https://www.npmjs.com/package/@asposecloud/aspose-imaging-cloud) |[Maven](https://repository.aspose.cloud/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-imaging-cloud)|
|
268
|
+
|
269
|
+
[Product Page](https://products.aspose.cloud/imaging/ruby) | [Documentation](https://docs.aspose.cloud/display/imagingcloud/Home) | [API Reference](https://apireference.aspose.cloud/imaging/) | [Code Samples](https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-ruby) | [Blog](https://blog.aspose.cloud/category/imaging/) | [Free Support](https://forum.aspose.cloud/c/imaging) | [Free Trial](https://dashboard.aspose.cloud/#/apps)
|
data/lib/aspose-imaging-cloud.rb
CHANGED
@@ -39,6 +39,7 @@ require_relative './aspose-imaging-cloud/models/dicom_properties'
|
|
39
39
|
require_relative './aspose-imaging-cloud/models/disc_usage'
|
40
40
|
require_relative './aspose-imaging-cloud/models/djvu_properties'
|
41
41
|
require_relative './aspose-imaging-cloud/models/dng_properties'
|
42
|
+
require_relative './aspose-imaging-cloud/models/eps_properties'
|
42
43
|
require_relative './aspose-imaging-cloud/models/error'
|
43
44
|
require_relative './aspose-imaging-cloud/models/error_details'
|
44
45
|
require_relative './aspose-imaging-cloud/models/exif_data'
|
@@ -32,13 +32,13 @@ module AsposeImagingCloud
|
|
32
32
|
attr_accessor :api_client
|
33
33
|
|
34
34
|
# Initializes a new instance of the ImagingApi class.
|
35
|
-
# @param [String]
|
36
|
-
# @param [String]
|
35
|
+
# @param [String] client_secret Key to access the server.
|
36
|
+
# @param [String] client_id ID to access the server.
|
37
37
|
# @param [String] base_url Server URL.
|
38
38
|
# @param [String] api_version Api version.
|
39
39
|
# @param [Object] debug Debug switch [true, false].
|
40
|
-
def initialize(
|
41
|
-
@api_client = ApiClient.new(
|
40
|
+
def initialize(client_secret = nil, client_id = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
|
41
|
+
@api_client = ApiClient.new(client_secret, client_id, base_url, api_version, debug)
|
42
42
|
end
|
43
43
|
|
44
44
|
# Add image and images features to search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
|
@@ -446,7 +446,7 @@ module AsposeImagingCloud
|
|
446
446
|
make_request(http_request, :GET, 'SearchResultsSet')
|
447
447
|
end
|
448
448
|
|
449
|
-
#
|
449
|
+
# Gets available labels for selected object detection method.
|
450
450
|
# @param [get_available_labelsRequest] request Request object.
|
451
451
|
# @return [AvailableLabelsList]
|
452
452
|
def get_available_labels(request)
|
@@ -725,13 +725,8 @@ module AsposeImagingCloud
|
|
725
725
|
private
|
726
726
|
|
727
727
|
def make_request(http_request, method, return_type)
|
728
|
+
ensure_token
|
728
729
|
call_api(http_request, method, return_type)
|
729
|
-
rescue ApiError => e
|
730
|
-
if e.code.equal? 401
|
731
|
-
request_token
|
732
|
-
return call_api(http_request, method, return_type)
|
733
|
-
end
|
734
|
-
raise
|
735
730
|
|
736
731
|
end
|
737
732
|
|
@@ -747,13 +742,17 @@ module AsposeImagingCloud
|
|
747
742
|
response[0]
|
748
743
|
end
|
749
744
|
|
745
|
+
def ensure_token
|
746
|
+
request_token unless @api_client.config.access_token
|
747
|
+
end
|
748
|
+
|
750
749
|
def request_token
|
751
750
|
config = @api_client.config
|
752
751
|
request_url = '/connect/token'
|
753
752
|
form_params =
|
754
753
|
{
|
755
754
|
'grant_type': 'client_credentials',
|
756
|
-
'client_id': config.api_key[:
|
755
|
+
'client_id': config.api_key[:client_id],
|
757
756
|
'client_secret': config.api_key[:api_key]
|
758
757
|
}
|
759
758
|
|
@@ -45,16 +45,16 @@ module AsposeImagingCloud
|
|
45
45
|
attr_accessor :default_headers
|
46
46
|
|
47
47
|
# Initializes the ApiClient
|
48
|
-
# @param [String]
|
49
|
-
# @param [String]
|
48
|
+
# @param [String] client_secret Key to access the server.
|
49
|
+
# @param [String] client_id ID to access the server.
|
50
50
|
# @param [String] base_url Server URL.
|
51
51
|
# @param [String] api_version Api version.
|
52
52
|
# @param [Object] debug Debug switch [true, false].
|
53
|
-
def initialize(
|
54
|
-
@config = Configuration.new(
|
53
|
+
def initialize(client_secret = nil, client_id = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
|
54
|
+
@config = Configuration.new(client_secret, client_id, base_url, api_version, debug)
|
55
55
|
@default_headers = {
|
56
56
|
'x-aspose-client' => 'ruby sdk',
|
57
|
-
'x-aspose-version' => '
|
57
|
+
'x-aspose-version' => '21.2'
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
@@ -149,18 +149,18 @@ module AsposeImagingCloud
|
|
149
149
|
attr_accessor :force_ending_format
|
150
150
|
|
151
151
|
# Initializes a new instance.
|
152
|
-
# @param [String]
|
153
|
-
# @param [String]
|
152
|
+
# @param [String] client_secret Key to access the server.
|
153
|
+
# @param [String] client_id ID to access the server.
|
154
154
|
# @param [String] base_url Server URL.
|
155
155
|
# @param [String] api_version Api version.
|
156
156
|
# @param [Object] debug Debug switch [true, false].
|
157
|
-
def initialize(
|
157
|
+
def initialize(client_secret = nil, client_id = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
|
158
158
|
@scheme = 'https'
|
159
159
|
self.host = base_url
|
160
160
|
@api_version = api_version
|
161
161
|
self.base_path = @api_version
|
162
|
-
@api_key = { 'api_key':
|
163
|
-
'
|
162
|
+
@api_key = { 'api_key': client_secret || '',
|
163
|
+
'client_id': client_id || '' }
|
164
164
|
@api_key_prefix = {}
|
165
165
|
@timeout = 0
|
166
166
|
@client_side_validation = true
|
@@ -173,7 +173,7 @@ module AsposeImagingCloud
|
|
173
173
|
@inject_format = false
|
174
174
|
@force_ending_format = false
|
175
175
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
176
|
-
@on_premise = (!(
|
176
|
+
@on_premise = (!(client_secret || client_id) && base_url)
|
177
177
|
|
178
178
|
yield(self) if block_given?
|
179
179
|
end
|
@@ -0,0 +1,241 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="eps_properties.rb">
|
3
|
+
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
|
4
|
+
# </copyright>
|
5
|
+
# <summary>
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
7
|
+
# copy of this software and associated documentation files (the "Software"),
|
8
|
+
# to deal in the Software without restriction, including without limitation
|
9
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
10
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
11
|
+
# Software is furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
22
|
+
# DEALINGS IN THE SOFTWARE.
|
23
|
+
# </summary>
|
24
|
+
# ----------------------------------------------------------------------------
|
25
|
+
|
26
|
+
|
27
|
+
require 'date'
|
28
|
+
|
29
|
+
module AsposeImagingCloud
|
30
|
+
class EpsProperties
|
31
|
+
# Gets the BoundingBox.
|
32
|
+
attr_accessor :bounding_box_string
|
33
|
+
|
34
|
+
# Gets the CreationDate.
|
35
|
+
attr_accessor :creation_date_string
|
36
|
+
|
37
|
+
# Gets the Creator.
|
38
|
+
attr_accessor :creator
|
39
|
+
|
40
|
+
# Gets the PostScript version.
|
41
|
+
attr_accessor :post_script_version
|
42
|
+
|
43
|
+
# Gets the Title.
|
44
|
+
attr_accessor :title
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:'bounding_box_string' => :'BoundingBoxString',
|
50
|
+
:'creation_date_string' => :'CreationDateString',
|
51
|
+
:'creator' => :'Creator',
|
52
|
+
:'post_script_version' => :'PostScriptVersion',
|
53
|
+
:'title' => :'Title'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.swagger_types
|
59
|
+
{
|
60
|
+
:'bounding_box_string' => :'String',
|
61
|
+
:'creation_date_string' => :'String',
|
62
|
+
:'creator' => :'String',
|
63
|
+
:'post_script_version' => :'String',
|
64
|
+
:'title' => :'String'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Initializes the object
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
70
|
+
def initialize(attributes = {})
|
71
|
+
return unless attributes.is_a?(Hash)
|
72
|
+
|
73
|
+
# convert string to symbol for hash key
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
75
|
+
|
76
|
+
if attributes.has_key?(:'BoundingBoxString')
|
77
|
+
self.bounding_box_string = attributes[:'BoundingBoxString']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'CreationDateString')
|
81
|
+
self.creation_date_string = attributes[:'CreationDateString']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'Creator')
|
85
|
+
self.creator = attributes[:'Creator']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.has_key?(:'PostScriptVersion')
|
89
|
+
self.post_script_version = attributes[:'PostScriptVersion']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.has_key?(:'Title')
|
93
|
+
self.title = attributes[:'Title']
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
98
|
+
# @return Array for valid properties with the reasons
|
99
|
+
def list_invalid_properties
|
100
|
+
invalid_properties = Array.new
|
101
|
+
invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
bounding_box_string == o.bounding_box_string &&
|
116
|
+
creation_date_string == o.creation_date_string &&
|
117
|
+
creator == o.creator &&
|
118
|
+
post_script_version == o.post_script_version &&
|
119
|
+
title == o.title
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Fixnum] Hash code
|
130
|
+
def hash
|
131
|
+
[bounding_box_string, creation_date_string, creator, post_script_version, title].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
self.class.swagger_types.each_pair do |key, type|
|
140
|
+
attribute_key = self.class.attribute_map[key]
|
141
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[attribute_key].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[attribute_key].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :BOOLEAN
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
temp_model = AsposeImagingCloud.const_get(type).new
|
194
|
+
temp_model.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
next if value.nil?
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Outputs non-array value in the form of hash
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
224
|
+
# @param [Object] value Any valid value
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
226
|
+
def _to_hash(value)
|
227
|
+
if value.is_a?(Array)
|
228
|
+
value.compact.map { |v| _to_hash(v) }
|
229
|
+
elsif value.is_a?(Hash)
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
232
|
+
end
|
233
|
+
elsif value.respond_to? :to_hash
|
234
|
+
value.to_hash
|
235
|
+
else
|
236
|
+
value
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
end
|
@@ -77,6 +77,9 @@ module AsposeImagingCloud
|
|
77
77
|
# Gets or sets the SVG properties.
|
78
78
|
attr_accessor :svg_properties
|
79
79
|
|
80
|
+
# Gets or sets the EPS properties.
|
81
|
+
attr_accessor :eps_properties
|
82
|
+
|
80
83
|
# Gets or sets the horizontal resolution of an image.
|
81
84
|
attr_accessor :horizontal_resolution
|
82
85
|
|
@@ -105,6 +108,7 @@ module AsposeImagingCloud
|
|
105
108
|
:'dng_properties' => :'DngProperties',
|
106
109
|
:'odg_properties' => :'OdgProperties',
|
107
110
|
:'svg_properties' => :'SvgProperties',
|
111
|
+
:'eps_properties' => :'EpsProperties',
|
108
112
|
:'horizontal_resolution' => :'HorizontalResolution',
|
109
113
|
:'vertical_resolution' => :'VerticalResolution',
|
110
114
|
:'is_cached' => :'IsCached'
|
@@ -130,6 +134,7 @@ module AsposeImagingCloud
|
|
130
134
|
:'dng_properties' => :'DngProperties',
|
131
135
|
:'odg_properties' => :'OdgProperties',
|
132
136
|
:'svg_properties' => :'SvgProperties',
|
137
|
+
:'eps_properties' => :'EpsProperties',
|
133
138
|
:'horizontal_resolution' => :'Float',
|
134
139
|
:'vertical_resolution' => :'Float',
|
135
140
|
:'is_cached' => :'BOOLEAN'
|
@@ -208,6 +213,10 @@ module AsposeImagingCloud
|
|
208
213
|
self.svg_properties = attributes[:'SvgProperties']
|
209
214
|
end
|
210
215
|
|
216
|
+
if attributes.has_key?(:'EpsProperties')
|
217
|
+
self.eps_properties = attributes[:'EpsProperties']
|
218
|
+
end
|
219
|
+
|
211
220
|
if attributes.has_key?(:'HorizontalResolution')
|
212
221
|
self.horizontal_resolution = attributes[:'HorizontalResolution']
|
213
222
|
end
|
@@ -285,6 +294,7 @@ module AsposeImagingCloud
|
|
285
294
|
dng_properties == o.dng_properties &&
|
286
295
|
odg_properties == o.odg_properties &&
|
287
296
|
svg_properties == o.svg_properties &&
|
297
|
+
eps_properties == o.eps_properties &&
|
288
298
|
horizontal_resolution == o.horizontal_resolution &&
|
289
299
|
vertical_resolution == o.vertical_resolution &&
|
290
300
|
is_cached == o.is_cached
|
@@ -299,7 +309,7 @@ module AsposeImagingCloud
|
|
299
309
|
# Calculates hash code according to all attributes.
|
300
310
|
# @return [Fixnum] Hash code
|
301
311
|
def hash
|
302
|
-
[height, width, bits_per_pixel, bmp_properties, gif_properties, jpeg_properties, png_properties, tiff_properties, psd_properties, djvu_properties, web_p_properties, jpeg2000_properties, dicom_properties, dng_properties, odg_properties, svg_properties, horizontal_resolution, vertical_resolution, is_cached].hash
|
312
|
+
[height, width, bits_per_pixel, bmp_properties, gif_properties, jpeg_properties, png_properties, tiff_properties, psd_properties, djvu_properties, web_p_properties, jpeg2000_properties, dicom_properties, dng_properties, odg_properties, svg_properties, eps_properties, horizontal_resolution, vertical_resolution, is_cached].hash
|
303
313
|
end
|
304
314
|
|
305
315
|
# Builds the object from hash
|
@@ -31,7 +31,7 @@ module AsposeImagingCloud
|
|
31
31
|
# Request model for get_available_labels operation.
|
32
32
|
class GetAvailableLabelsRequest < ImagingRequest
|
33
33
|
|
34
|
-
#
|
34
|
+
# Gets available labels for selected object detection method.
|
35
35
|
# @param [String] method Object detection method
|
36
36
|
def initialize(method)
|
37
37
|
@method = method
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_imaging_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '21.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergei Zubov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
|
@@ -18,7 +18,8 @@ description: |2
|
|
18
18
|
|
19
19
|
This repository contains Aspose.Imaging Cloud Ruby SDK source code. This SDK allows you to work with Aspose.Imaging Cloud REST APIs in your Ruby applications quickly and easily, with zero initial cost.
|
20
20
|
|
21
|
-
To use this SDK, you will need
|
21
|
+
To use this SDK, you will need Client ID and Client Key which can be looked up at Aspose Cloud Dashboard (free
|
22
|
+
registration in Aspose Cloud is required for this).
|
22
23
|
|
23
24
|
The solution is updated using code generator.
|
24
25
|
email: sergei.zubov@aspose.com
|
@@ -45,6 +46,7 @@ files:
|
|
45
46
|
- lib/aspose-imaging-cloud/models/disc_usage.rb
|
46
47
|
- lib/aspose-imaging-cloud/models/djvu_properties.rb
|
47
48
|
- lib/aspose-imaging-cloud/models/dng_properties.rb
|
49
|
+
- lib/aspose-imaging-cloud/models/eps_properties.rb
|
48
50
|
- lib/aspose-imaging-cloud/models/error.rb
|
49
51
|
- lib/aspose-imaging-cloud/models/error_details.rb
|
50
52
|
- lib/aspose-imaging-cloud/models/exif_data.rb
|