简体   繁体   中英

Google Cloud Storage Document Thumbnail Image?

We are needing to grab a thumbnail image of our documents on Google Could Storage for use in our Drupal module. Previously https://docs.google.com/viewer?url=DOC_STORAGE_URL&a=bi&pagenumber=1 worked for us, but the google viewer seems to no longer support the a=bi parameter.

Does anyone have any information about the viewer no longer generating a thumbnail, or know if there is a way to grab a thumbnail image of the document stored on Google Could Storage using its API like you can with the Drive API? We are currently using the google-api-php-client. https://developers.google.com/drive/v2/reference/files

Google Cloud Storage does not generate thumbnails for any objects. You would need to generate these thumbnails, upload them to Google Cloud Storage, and then reference them yourself.

As @rein said, GCS doesn't generate thumbnails for any object. But there is an alternative: the Images API. Although is not available for PHP, if you can write in Python [1] or JAVA [2] this library contains the functionality you are looking for.

Check the function get_serving_url here [3]. It will generate an url that accepts parameters. Specifically, the parameter =sXX will generates thumbnails of XX pixels (on the longest dimension).

[1] https://cloud.google.com/appengine/docs/python/images/

[2] https://cloud.google.com/appengine/docs/java/images/

[3] https://cloud.google.com/appengine/docs/python/images/functions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM