# \[PAID\] Integrate Google Cloud Vistion API into upload process

**URL:** https://meta.discourse.org/t/paid-integrate-google-cloud-vistion-api-into-upload-process/161746
**Category:** Marketplace
**Created:** [August 22, 2020, 9:04am UTC](https://meta.discourse.org/t/paid-integrate-google-cloud-vistion-api-into-upload-process/161746 "2020-08-22T09:04:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)
#### Post date: [August 22, 2020, 9:04am UTC](https://meta.discourse.org/t/paid-integrate-google-cloud-vistion-api-into-upload-process/161746/1 "2020-08-22T09:04:35Z")

</div>

A plugin that checks all images uploaded to Discourse via the Google Cloud Vision API and rejects if not appropriate according to set levels.

Documentation:

> **[Vision-Clientbibliotheken  |  Cloud Vision API  |  Google Cloud Documentation](https://docs.cloud.google.com/vision/docs/libraries?hl=de)**
>
> Sie können Code für Vision in Python, Java, Node.js, Ruby, Go, PHP, C# und C++ schreiben.

A Ruby Gem is provided by Google:

> **[Ruby Client for the Cloud Vision API  |  Ruby client libraries  |  Google...](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision/latest)**

> **[Ruby Client for the Cloud Vision API  |  Ruby client libraries  |  Google...](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision/latest)**

> **[Detect explicit content (SafeSearch)  |  Cloud Vision API  |  Google Cloud...](https://docs.cloud.google.com/vision/docs/detecting-safe-search)**

This plugin should hook into the main image upload process of Discourse for all images (posts, avatars, profile backgrounds etc.) and reject images that contain disallowed content:

```plaintext
  puts "Adult: #{safe_search.adult}" puts "Spoof: #{safe_search.spoof}" puts "Medical: #{safe_search.medical}" puts "Violence: #{safe_search.violence}" puts "Racy: #{safe_search.racy}"

```

```plaintext
['UNKNOWN', 'VERY_UNLIKELY', 'UNLIKELY', 'POSSIBLE', 'LIKELY', 'VERY_LIKELY']

```

The min likelihoods to reject uploads for the various flag categories (Adult, Sppor, Medical, Violence, Racy) should be configurable in the plugin settings.

Rejected images should be removed instantly and don’t be saved anywhere.

Supported image formats by Google Cloud Vision:

> **[Supported image formats and dimensions  |  Cloud Vision API  |  Google Cloud...](https://docs.cloud.google.com/vision/docs/supported-files)**
>
> Learn about supported image formats, dimensions, and file size limits for the API. Understand considerations for image accuracy and feature detection.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [August 22, 2020, 9:08am UTC](https://meta.discourse.org/t/paid-integrate-google-cloud-vistion-api-into-upload-process/161746/2 "2020-08-22T09:08:04Z")

</div>

Thanks. @Terrapop has gone ahead with me on this.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 21, 2020, 9:13am UTC](https://meta.discourse.org/t/paid-integrate-google-cloud-vistion-api-into-upload-process/161746/3 "2020-09-21T09:13:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
