Skip to content

detectText provide base64 #2123

Description

@EasonWang01

improve the function to able to read base64.

And improve your error message for more specific.

Activity

  1. stephenplusplus commented on Mar 22, 2017

    @stephenplusplus
    Contributor

    Can you show example code that you'd like to work, as well as the error (and how you got it)?

  2. EasonWang01 commented on Mar 22, 2017

    @EasonWang01
    Author

    GoogleCloudPlatform/cloud-vision#112

    Using nodejs lib and provide file path works fine,but not works for base64 string.

  3. lukesneeringer commented on Mar 22, 2017

    @lukesneeringer
    Contributor

    As best as I can tell, he is referencing this code, which is in of itself quite cryptic.

  4. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: questionRequest for information or clarification. Not an issue.
    on Mar 22, 2017
  5. EasonWang01 commented on Mar 22, 2017

    @EasonWang01
    Author

    Google's example got wrong here for "images" but only one content keys in the payload.
    The problem might be the "s".

    But no suprise,because Google no response to my mail for up to 5 times including GCE and other services for both tech and sales.

    00

    Where is the detectText function write in this Repo?Because only find it in the describe and Readme.

    Thanks for reply.

  6. stephenplusplus commented on Mar 22, 2017

    @stephenplusplus
    Contributor

    Our detectText function is here: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/a3c455f765822a24d87adb3c2469b5e31b8288f2/packages/vision/src/index.js#L1535 - which as you'll see, is just a wrapper around detect() that specifies the text type.

    Your input is fed to findImages_, a helper function which can take multiple forms of input and figure out how to send them to the API. The first case it handles is for Buffer types, which it will send through as base64.

    So, I believe we support the feature you're looking for, however, provide the base64 string as a Buffer:

    var input = new Buffer(myBase64String, 'base64')
    
    vision.detectText(input, ...
  7. stephenplusplus commented on Mar 28, 2017

    @stephenplusplus
    Contributor

    PR sent with an addition to the docs to make this more clear: #2145

  8. added 2 commits that reference this issue on Feb 26, 2026
    047d2ab
    92c721b
  9. added a commit that references this issue on Mar 11, 2026
  10. added a commit that references this issue on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions