View Single Post
Old April 21st, 2022, 10:29 AM
rkury14 rkury14 is offline
Regular Contributor
Join Date: May 2014
Location: Tempe, AZ
Posts: 56
Default Need help scaling images from url link


I have a "CreateResource" rule here that seems to work on a URL Link with https://, but the images are coming in at different sizes. Too small or too big.
How can I add a scaling code into the rule to make the images uniform?

Here is the js rule.

var baseName = Field("URL");

var extensions = [".tif", "gif", ".png", ".jpg"];
for (var i in extensions)

{ var pic = CreateResource(Field ("URL") + extensions[i], + "graphic", true);
if (pic.exists)
return pic;}

Print("" + Field ("URL") + " not found.");
return CreateResource(Field ("URL"))
return NullResource();

Thank you,
Reply With Quote