Can I use Unpic with a custom image server? #797
Unanswered
juliomuhlbauer
asked this question in
Q&A
Replies: 1 comment
-
|
My image loader from nextjs: export default function collabsImageLoader({ src, width, quality }) {
const isLocal = !src.startsWith("http");
const query = new URLSearchParams();
const imageOptimizationApi = "https://images.coollabs.io/o";
// Your NextJS application URL
const baseUrl = APP.URL;
const fullSrc = `${baseUrl}${src}`;
if (quality) query.set("quality", quality);
if (width) query.set("width", width);
if (
isLocal
// && process.env.NODE_ENV === "development"
) {
return src;
}
// if (isLocal) {
// return `${imageOptimizationApi}/${fullSrc}?${query.toString()}`;
// }
return `${imageOptimizationApi}/${src}?${query.toString()}`;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have custom image optimization server with a custom ULR builder for the image.
With the Nextjs image I can customize the loader. How do I do that with Unpic?
Beta Was this translation helpful? Give feedback.
All reactions