webrequest pkg, web request bar

This commit is contained in:
Sebastian Frank
2019-03-27 12:52:30 +01:00
parent 4cb09fb81f
commit 5d6d03702e
5 changed files with 30 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/jobm"
"gitbase.de/apairon/mark2web/pkg/logger"
"gitbase.de/apairon/mark2web/pkg/mark2web"
"gitbase.de/apairon/mark2web/pkg/webrequest"
"github.com/disintegration/imaging"
"github.com/flosch/pongo2"
)
@@ -153,7 +154,7 @@ func ImageProcessFilter(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *
logger.Log.Noticef("processing image from %s to %s", imgSource, imgTarget)
if strings.HasPrefix(imgSource, "http://") || strings.HasPrefix(imgSource, "https://") {
// remote file
img, p.Format, err = helper.ImageWebRequest(imgSource)
img, p.Format, err = webrequest.GetImage(imgSource)
} else {
img, err = imaging.Open(imgSource, imaging.AutoOrientation(true))
}