Can we pass complete URL to the image resizer? #550
-
Hey, We have an old serverless image resizer (created 4 years ago) that can handle this but recently, we created a new resizer (v6.5) that throws an error as you can see. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I can't tell you the details of why, but https://d2sv1t07lr5mwo.cloudfront.net/fit-in/3840x3840/filters:quality(100):format(webp)/media/images/city-landing-pages/banner-images/toronto.jpg looks like it works (without the domain in the source image path) |
Beta Was this translation helpful? Give feedback.
-
Hi @sh-soltanpour, I might need some more info to help here, The old instance of SIH you had running, what version was it? What is the purpose surrounding the CloudFront url in the latter half of the request? Is that a CloudFront distribution with your S3 bucket as the origin? The current implementation of SIH expects that the S3 bucket used to host the source images is provided in the SOURCE_BUCKETS template parameter, and that the image key is provided as part of the URL path (like in Rob's answer). I've done a quick look through the code of some previous versions, and I haven't found anything post Lambda->Typescript rewrite that would support URLs being included as the path. Let me know, |
Beta Was this translation helpful? Give feedback.
Hi @sh-soltanpour,
The functionality you're seeing is expected, it looks like 4 years ago with the release of v4 and alongside the Python->Typescript migration is when the ability to include a link to the image was removed. If you were looking not to change the legacy code that generates the URL, and the images being accessed are all present in the same S3 Bucket (which is the first value in the SOURCE_BUCKETS template parameter) you could try the following workaround:
Follow https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/use-the-rewrite-feature.html to use the rewrite feature supported by SIH (Will need to change the Environment variables of the backend lambda func…