Skip to content

Commit b2959ad

Browse files
sirtorryryanmats
authored andcommitted
new vision client (GoogleCloudPlatform#565)
* new client and samples * remove .ds_store * remove .ds_store * fix tags * update tests and README * add lock file * fix syntax issues * fix variable name * typo * fix test * add web-geo test * fix repeated test * undo .gitignore change * troubleshooting
1 parent a1924aa commit b2959ad

30 files changed

+1100
-821
lines changed

vision/README.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,49 @@ Vision API from PHP.
2828
5. For a basic demonstration of the Cloud Vision API, run `php quickstart.php`.
2929
6. Run `php vision.php`. The following commands are available:
3030
```
31-
face Detect faces in an image using Google Cloud Vision API
32-
help Displays help for a command
33-
label Detect labels in an image using Google Cloud Vision API
34-
landmark Detect landmarks in an image using Google Cloud Vision API
35-
list Lists commands
36-
logo Detect logos in an image using Google Cloud Vision API
37-
property Detect image proerties in an image using Google Cloud Vision API
38-
safe-search Detect adult content in an image using Google Cloud Vision API
39-
text Detect text in an image using Google Cloud Vision API
40-
crop-hints Detect crop hints in an image using Google Cloud Vision API
41-
document-text Detect document text in an image using Google Cloud Vision API
42-
web Detect web entities in an image using Google Cloud Vision API
31+
face Detect faces in an image using Google Cloud Vision API
32+
help Displays help for a command
33+
label Detect labels in an image using Google Cloud Vision API
34+
landmark Detect landmarks in an image using Google Cloud Vision API
35+
list Lists commands
36+
logo Detect logos in an image using Google Cloud Vision API
37+
property Detect image proerties in an image using Google Cloud Vision API
38+
safe-search Detect adult content in an image using Google Cloud Vision API
39+
text Detect text in an image using Google Cloud Vision API
40+
crop-hints Detect crop hints in an image using Google Cloud Vision API
41+
document-text Detect document text in an image using Google Cloud Vision API
42+
web Detect web entities in an image using Google Cloud Vision API
43+
web-geo Detect web entities in an image with geo metadata using
44+
Google Cloud Vision API
4345
```
4446
7. Run `php vision.php COMMAND --help` to print information about the usage of each command.
4547

48+
## The client library
49+
50+
This sample uses the [Google Cloud Client Library for PHP][google-cloud-php].
51+
You can read the documentation for more details on API usage and use GitHub
52+
to [browse the source][google-cloud-php-source] and [report issues][google-cloud-php-issues].
53+
54+
## Troubleshooting
55+
56+
If you get the following error, set the environment variable `GCLOUD_PROJECT` to your project ID:
57+
58+
```
59+
[Google\Cloud\Core\Exception\GoogleException]
60+
No project ID was provided, and we were unable to detect a default project ID.
61+
```
62+
63+
If you have not set a timezone you may get an error from php. This can be resolved by:
64+
65+
1. Finding where the php.ini is stored by running `php -i | grep 'Configuration File'`
66+
1. Finding out your timezone from the list on this page: http://php.net/manual/en/timezones.php
67+
1. Editing the php.ini file (or creating one if it doesn't exist)
68+
1. Adding the timezone to the php.ini file e.g., adding the following line: `date.timezone = "America/Los_Angeles"`
69+
70+
[google-cloud-php]: https://googlecloudplatform.github.io/google-cloud-php
71+
[google-cloud-php-source]: https://github.com/GoogleCloudPlatform/google-cloud-php
72+
[google-cloud-php-issues]: https://github.com/GoogleCloudPlatform/google-cloud-php/issues
73+
4674
## Contributing changes
4775

4876
* See [CONTRIBUTING.md](../../CONTRIBUTING.md)

vision/composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "google/translate-sample",
2+
"name": "google/vision",
33
"type": "project",
44
"require": {
5-
"google/cloud-vision": "^0.9",
5+
"google/cloud-vision": "^0.10",
66
"google/cloud-storage": "^1.3",
77
"symfony/console": "^3.1"
88
},
@@ -30,7 +30,9 @@
3030
"src/detect_document_text.php",
3131
"src/detect_document_text_gcs.php",
3232
"src/detect_web.php",
33-
"src/detect_web_gcs.php"
33+
"src/detect_web_gcs.php",
34+
"src/detect_web_with_geo_metadata.php",
35+
"src/detect_web_with_geo_metadata_gcs.php"
3436
]
3537
},
3638
"require-dev": {

0 commit comments

Comments
 (0)