Image check in lambda handler
This commit is contained in:
parent
77b972a1b2
commit
ec1f4dc284
1 changed files with 3 additions and 0 deletions
|
@ -117,6 +117,9 @@ def genImageFromURL(urlArray):
|
||||||
|
|
||||||
def lambda_handler(event, context):
|
def lambda_handler(event, context):
|
||||||
images = event["queryStringParameters"].get("imgs","").split(",")
|
images = event["queryStringParameters"].get("imgs","").split(",")
|
||||||
|
for img in images:
|
||||||
|
if not img.startswith("https://pbs.twimg.com"):
|
||||||
|
return {'statusCode':400,'body':'Invalid image URL'}
|
||||||
combined = genImageFromURL(images)
|
combined = genImageFromURL(images)
|
||||||
buffered = BytesIO()
|
buffered = BytesIO()
|
||||||
combined.save(buffered,format="JPEG",quality=60)
|
combined.save(buffered,format="JPEG",quality=60)
|
||||||
|
|
Loading…
Reference in a new issue