Skip to content

Commit 89207d7

Browse files
authored
Release 24.4 (#68)
* Add scanBarcode endpoint * Version 24.4.0
1 parent b50dd25 commit 89207d7

File tree

116 files changed

+448
-2899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+448
-2899
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/aspose/barcode-cloud-php/php)](https://packagist.org/packages/aspose/barcode-cloud-php)
77

88
- API version: 3.0
9-
- Package version: 24.3.0
9+
- Package version: 24.4.0
1010
- Supported PHP versions: ">=7.4 || >=8.0"
1111

1212
## Demo applications
@@ -96,6 +96,7 @@ Class | Method | HTTP request | Description
9696
*BarcodeApi* | [**putBarcodeGenerateFile**](docs/Api/BarcodeApi.md#putbarcodegeneratefile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
9797
*BarcodeApi* | [**putBarcodeRecognizeFromBody**](docs/Api/BarcodeApi.md#putbarcoderecognizefrombody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.
9898
*BarcodeApi* | [**putGenerateMultiple**](docs/Api/BarcodeApi.md#putgeneratemultiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server
99+
*BarcodeApi* | [**scanBarcode**](docs/Api/BarcodeApi.md#scanbarcode) | **POST** /barcode/scan | Quickly scan a barcode from an image.
99100
*FileApi* | [**copyFile**](docs/Api/FileApi.md#copyfile) | **PUT** /barcode/storage/file/copy/{srcPath} | Copy file
100101
*FileApi* | [**deleteFile**](docs/Api/FileApi.md#deletefile) | **DELETE** /barcode/storage/file/{path} | Delete file
101102
*FileApi* | [**downloadFile**](docs/Api/FileApi.md#downloadfile) | **GET** /barcode/storage/file/{path} | Download file

docs/Api/BarcodeApi.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Method | HTTP request | Description
1111
[**putBarcodeGenerateFile**](BarcodeApi.md#putBarcodeGenerateFile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
1212
[**putBarcodeRecognizeFromBody**](BarcodeApi.md#putBarcodeRecognizeFromBody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.
1313
[**putGenerateMultiple**](BarcodeApi.md#putGenerateMultiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server
14+
[**scanBarcode**](BarcodeApi.md#scanBarcode) | **POST** /barcode/scan | Quickly scan a barcode from an image.
1415

1516

1617
# **getBarcodeGenerate**
@@ -185,7 +186,7 @@ $fast_scan_only = true; // bool | Allows engine for 1D barcodes to quickly recog
185186
$allow_additional_restorations = true; // bool | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False.
186187
$region_likelihood_threshold_percent = 1.2; // double | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time.
187188
$scan_window_sizes = array(56); // int[] | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality.
188-
$similarity = 1.2; // double | Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9]
189+
$similarity = 1.2; // double | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9]
189190
$skip_diagonal_search = true; // bool | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time.
190191
$read_tiny_barcodes = true; // bool | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False.
191192
$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
@@ -238,7 +239,7 @@ Name | Type | Description | Notes
238239
**allow_additional_restorations** | **bool**| Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional]
239240
**region_likelihood_threshold_percent** | **double**| Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional]
240241
**scan_window_sizes** | [**int[]**](../Model/int.md)| Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional]
241-
**similarity** | **double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
242+
**similarity** | **double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
242243
**skip_diagonal_search** | **bool**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
243244
**read_tiny_barcodes** | **bool**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
244245
**australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional]
@@ -311,7 +312,7 @@ $fast_scan_only = true; // bool | Allows engine for 1D barcodes to quickly recog
311312
$allow_additional_restorations = true; // bool | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False.
312313
$region_likelihood_threshold_percent = 1.2; // double | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time.
313314
$scan_window_sizes = array(56); // int[] | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality.
314-
$similarity = 1.2; // double | Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9]
315+
$similarity = 1.2; // double | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9]
315316
$skip_diagonal_search = true; // bool | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time.
316317
$read_tiny_barcodes = true; // bool | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False.
317318
$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
@@ -363,7 +364,7 @@ Name | Type | Description | Notes
363364
**allow_additional_restorations** | **bool**| Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional]
364365
**region_likelihood_threshold_percent** | **double**| Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional]
365366
**scan_window_sizes** | [**int[]**](../Model/int.md)| Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional]
366-
**similarity** | **double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
367+
**similarity** | **double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
367368
**skip_diagonal_search** | **bool**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
368369
**read_tiny_barcodes** | **bool**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
369370
**australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional]
@@ -684,3 +685,58 @@ Name | Type | Description | Notes
684685

685686
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
686687

688+
# **scanBarcode**
689+
> \Aspose\BarCode\Model\BarcodeResponseList scanBarcode($image_file, $decode_types, $timeout)
690+
691+
Quickly scan a barcode from an image.
692+
693+
### Example
694+
```php
695+
<?php
696+
require_once(__DIR__ . '/vendor/autoload.php');
697+
698+
// Configure OAuth2 access token for authorization: JWT
699+
$config = Aspose\BarCode\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
700+
701+
$apiInstance = new Aspose\BarCode\Api\BarcodeApi(
702+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
703+
// This is optional, `GuzzleHttp\Client` will be used as default.
704+
new GuzzleHttp\Client(),
705+
$config
706+
);
707+
$image_file = "/path/to/file.txt"; // \SplFileObject | Image as file
708+
$decode_types = array(new \Aspose\BarCode\Model\\Aspose\BarCode\Model\DecodeBarcodeType()); // \Aspose\BarCode\Model\DecodeBarcodeType[] | Types of barcode to recognize
709+
$timeout = 56; // int | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout.
710+
711+
try {
712+
$result = $apiInstance->scanBarcode($image_file, $decode_types, $timeout);
713+
print_r($result);
714+
} catch (Exception $e) {
715+
echo 'Exception when calling BarcodeApi->scanBarcode: ', $e->getMessage(), PHP_EOL;
716+
}
717+
?>
718+
```
719+
720+
### Parameters
721+
722+
Name | Type | Description | Notes
723+
------------- | ------------- | ------------- | -------------
724+
**image_file** | **\SplFileObject**| Image as file |
725+
**decode_types** | [**\Aspose\BarCode\Model\DecodeBarcodeType[]**](../Model/\Aspose\BarCode\Model\DecodeBarcodeType.md)| Types of barcode to recognize | [optional]
726+
**timeout** | **int**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional]
727+
728+
### Return type
729+
730+
[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md)
731+
732+
### Authorization
733+
734+
[JWT](../../README.md#JWT)
735+
736+
### HTTP request headers
737+
738+
- **Content-Type**: multipart/form-data
739+
- **Accept**: application/json
740+
741+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
742+

docs/Model/AustralianPostParams.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AustralianPost barcode parameters.
55
## Properties
66
Name | Type | Description | Notes
77
---- | ---- | ----------- | -----
8-
**encoding_table** | [**\Aspose\BarCode\Model\CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other\&quot; | [optional]
8+
**encoding_table** | [**\Aspose\BarCode\Model\CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other | [optional]
99
**short_bar_height** | **double** | Short bar&#39;s height of AustralianPost barcode. | [optional]
1010

1111
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

docs/Model/ReaderParams.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Name | Type | Description | Notes
3636
**allow_additional_restorations** | **bool** | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional]
3737
**region_likelihood_threshold_percent** | **double** | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional]
3838
**scan_window_sizes** | **int[]** | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional]
39-
**similarity** | **double** | Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
39+
**similarity** | **double** | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
4040
**skip_diagonal_search** | **bool** | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
4141
**read_tiny_barcodes** | **bool** | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
4242
**australian_post_encoding_table** | [**\Aspose\BarCode\Model\CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional]

src/Aspose/BarCode/ApiException.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?php
22

33
declare(strict_types=1);
4-
//
5-
// This source code was auto-generated by AsposeBarcodeCloudCodegen.
6-
//
74

85
namespace Aspose\BarCode;
96

0 commit comments

Comments
 (0)