
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2020 05:05 AM
I was wondering if anyone here has managed to write a piece of code in the scripting block to
- Resize an existing attachment file to match certain dimensions programmatically
- Obtain the pixel dimensions (height and width) of a image attachment
and most interestingly - Call Google Vision to run Image Analytics on a image attachment, pulling the results into a text or linked field in Airtable…
Cheers,
Martin

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2020 05:28 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2020 06:39 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2020 09:20 AM
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?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2020 09:52 AM
That’s how we did it - all Google Apps Script (javascript). It may be possible in Airtable (javascript) but not likely financially practical.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 15, 2022 01:11 PM
were you able to extract custom metadata (XMP) within that script?
I’m only able to grab this much, but I know there’s more.
{
“date”:“2019:11:09 14:11:09”,
“whiteBalance”:“Manual”,
“subjectDistance”:0,
“height”:3956,
“meteringMode”:“CenterWeightedAverage”,
“cameraModel”:“FC6520”,
“isoSpeed”:200,
“cameraMake”:“DJI”,
“exposureTime”:0.01,
“exposureBias”:1.65625,
“colorSpace”:“sRGB”,
“flashUsed”:false,
“rotation”:0,
“maxApertureValue”:1.69,
“aperture”:8,
“width”:5280,
“location”:{
“altitude”:131.602,
“latitude”:33.43046261111111,
“longitude”:-117.19567805555556
},
“exposureMode”:“Auto”,
“focalLength”:45
}
