Usage:

/thumbs/p-(profile)-ver1/(filename in source bucket)

/txtimg/?querystring (check bottom)

/txtimg/encrypted (check bottom)

Environment Variables:

config_event_logyes/no
config_event_log_tablename
config_event_log_key
config_product_key
config_cache_in_daysdefault 30
config_read_buckets_mandatoryyes/no
config_read_bucketscomma separated values
config_write_buckets_mandatoryyes/no
config_write_bucketscomma separated values
config_error_imageurl
config_log_targetdynamodb/firehose
config_log_tablenamedynamodb tablename
config_log_topicfirehose topic
config_enable_access_logyes/no
config_enable_error_logyes/no
 

Sample profiles:

{
	"product": "ONE",
	"profiles": {
		"profile1": {
			"ACL": "public-read",
			"d_b": "ct-cartrade-thumbs",
			"error_image": "4_3",
			"h": "225",
			"m": "crop",
			"M": "image/jpeg",
			"s_b": "ct-cartrade",
			"w": "300"
		},
		"profile2": {
			"ACL": "public-read",
			"d_b": "ct-cartrade-thumbs",
			"error_image": "4_3",
			"h": "225",
			"m": "crop",
			"M": "image/jpeg",
			"s_b": "ct-cartrade",
			"w": "300"
		},
	}
}

Query Params:

Property ValueMandatoryDescription
w numericYesWidth
h numericYesHeight
s_b stringYesSource Bucket
s_k stringYesSource Key
d_b stringYesDestination Bucket
d_k stringYesDestination Key
ACL private,public,public-readYesAccess Control
M image/jpeg, image/png Output MIME Type
m crop, fill  Mode
b_c 255,255,255 Background Color. RGB values.
wm 0, 1  WaterMark
wm_b stringYesWaterMark Bucket
wm_k stringYesWaterMark Key
wm_p TL,TR,BL,BR,CYesPosition TopLeft,TopRight,BottomLeft,BottomRight,Center
wm_s numberYesSize in %
wm_t 4,8,16 Watermark Tiles
wm_o 0.0 to 10 Watermark Opacity
t 1 Text Write
t_t StringYesText to Write (should be urlencoded, no special chars)
Use _NL_ to give line break
t_p TL,BLYesPosition
t_s numberYesFont Size
t_c 255,255,255YesFont Color. RGB values
n_s 1 Do not save file. no destination bucket required
resize again Force recreation of thumb, even if already generated

 

event log dynamodb table format:
{
	"logname" => "",  pk
	"time" => date("Y-m-d H:i:s"),  sk
	"expire" => time() + ( 30 * 86400 ),
	"event" => requestContext json array
}

 

/txtimg?querystring

/txtimg?encrypted_querystring

encrypted_querystring = base64url_encode ( gzcompress( json_encode( \$query ) ))

Property ValueMandatoryDescription
w numericYesWidth
h numericYesHeight
M image/jpeg, image/png Output MIME Type
b_c 255,255,255 Background Color. RGB values.
t_t StringYesText to Write (should be urlencoded, no special chars)
Use _NL_ to give line break
t_s numberYesFont Size
t_c 255,255,255YesFont Color. RGB values
f Arial
ArialBold
Ubuntu-Regular
Ubuntu-Bold
Ubuntu-Italic
Ubuntu-BoldItalic
Ubuntu-Light
Ubuntu-LightItalic
YesFont