Steve Reeder
Steve Reeder

Reputation: 1022

Using SuiteScript to extract metadata from Images in the file cabinet

I'm looking to build a particular solution for a client which needs to dynamically resize images stored in the Netsuite file cabinet.

Is there any way within suitescript/netsuite to grab the width and height of an image in the file cabinet?

Cheers!

Upvotes: 2

Views: 754

Answers (3)

bknights
bknights

Reputation: 15437

Netsuite doesn't have anything native for this but a simple-ish solution would be to create a node app on AWS Lambda that accepts an image and resizes it.

You can't deploy a user event script on images so you'd be stuck with a scheduled script or a map reduce script. You can feed that with a list of images created since some date/time or you could set a User Note when the image has been resized and filter against that.

I've used the node package 'sharp' for this sort of thing and the speed and quality are good.

Upvotes: 1

Rusty Shackles
Rusty Shackles

Reputation: 2840

SuiteScript is basically javascript so if you can find any third party library that does this, you can add that.

Upvotes: 2

Suite Resources
Suite Resources

Reputation: 1164

I don't know if you can do this with SuiteScript, but you can do it via Web Services. If you do a "get" on each image file with PHP, you can then use the PHP getimagesize function to get the image dimensions.

Upvotes: 1

Related Questions