Skip to content

Conversation

@daspecster
Copy link
Contributor

Image content was not being properly encoded before being JSON serialized for the request.

Fixes #2525.

@daspecster daspecster added the api: vision Issues related to the Cloud Vision API. label Oct 11, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 11, 2016
image_request = client.connection._requested[0]['data']['requests'][0]
# json_dump = json.dumps(image_request['image']['content'])
# self.assertEqual(json_dump, self.B64_IMAGE_CONTENT)

This comment was marked as spam.

This comment was marked as spam.

class TestClient(unittest.TestCase):
import base64
from google.cloud._helpers import _to_bytes
from google.cloud._helpers import _bytes_to_unicode

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@daspecster
Copy link
Contributor Author

@tseaver, I moved the imports and constants for the other test I updated for this.

LMKWYT

@daspecster daspecster force-pushed the vision-type-error-2525 branch from e85c772 to 0e992eb Compare October 12, 2016 14:25
@daspecster daspecster merged commit 09078c1 into googleapis:master Oct 12, 2016
@daspecster daspecster deleted the vision-type-error-2525 branch October 12, 2016 14:40
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vision Issues related to the Cloud Vision API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants