diff options
Diffstat (limited to 'imagestore/strippath.go')
| -rw-r--r-- | imagestore/strippath.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/imagestore/strippath.go b/imagestore/strippath.go new file mode 100644 index 0000000..11ea12e --- /dev/null +++ b/imagestore/strippath.go @@ -0,0 +1,13 @@ +package imagestore + +import ( + "os" + "strings" +) + +func stripPath(url string) string { + ABSPATH := os.Getenv("UPLOAD_DIR") + URL := os.Getenv("UPLOAD_URL") + return URL + strings.Replace(strings.TrimPrefix(url, ABSPATH), "/original/", "/i/", 1) + //return URL + strings.TrimPrefix(url, ABSPATH) +} |
