Add imagekit fallback on no imagekit ID

This commit is contained in:
2025-07-29 17:55:16 +03:30
parent 051408fcdd
commit 71800440be
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -12,9 +12,15 @@ func InitImgKitHelper() {
}
func GetPreviewUrl(url string) string {
if config.Config.ImageKitId == "" {
return url
}
return "https://ik.imagekit.io/" + config.Config.ImageKitId + "/tr:w-500,h-500,c-at_max,f-webp,q-60/" + url
}
func GetRemoteUrl(url string) string {
if config.Config.ImageKitId == "" {
return url
}
return "https://ik.imagekit.io/" + config.Config.ImageKitId + "/tr:q-70,dpr-auto,f-webp/" + url
}