Image Processing (Resizing, Getting Metadata, Google Vision)

I was wondering if anyone here has managed to write a piece of code in the scripting block to

  1. Resize an existing attachment file to match certain dimensions programmatically
  2. Obtain the pixel dimensions (height and width) of a image attachment
    and most interestingly
  3. Call Google Vision to run Image Analytics on a image attachment, pulling the results into a text or linked field in Airtable…

Cheers,
Martin

I don’t have any JavaScript scripts for this (other people might), but you can do all of this with no coding at all using Integromat’s image transformation & Google Cloud Vision modules:

p.s. I am an Airtable consultant and a Registered Integromat Partner. If you have a budget for your project and need to hire a consultant to set this up for you, feel free to contact me through my website at scottworld.com.

Yep - done all three and for one project.

It’s impractical to do this in Airtable itself because you need to employ different services for each of your three tasks. To do this, I used – you guessed it – Google Apps Script because it offers seamless integration with their image manipulation SDK, the Vision SDK, and image meta SDK.

It’s not a walk in the park but it can all be done in a single webhook service that Airtable calls (passing in the table name/record ID). Then the Airtable API is called back for the details, attachment URL, etc. The script performs all the tasks and sends the result s back to the same record (or does other stuff as needed).

One of the nice things about Google Apps Script is it can serve as an automation layer with an integrated custom webhook layer as well as script triggering - all for pretty much no charge and it scales vastly beyond the limitations of no-code integration services.

Fantastic. It looks like i got to embrace app scripts don’t i…
Since the resizing is actually a different step in my process and actually one that’s more important to tackle, whereas obtaining image dimensions and calling the google vision SDK is something to be looked into at a later stage…
Would this be possible purely in javascript code?

That’s how we did it - all Google Apps Script (javascript). It may be possible in Airtable (javascript) but not likely financially practical.