Commit 01c66143 authored by Jürgen Enge's avatar Jürgen Enge
Browse files

readme changed

parent dbea6c82
......@@ -6,11 +6,17 @@ basierend auf einer Colormap, welche im Konfigurationsfile definiert wird.
go get gitlab.switch.ch/memoriav/memobase-2020/services/histogram
go build gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/histogram
go build gitlab.switch.ch/memoriav/memobase-2020/services/histogram/cmd/webservice
## Start:
### Commandline Histogram
histogram -cfg histogram.toml -img bildchen.jpg
### Webservice
webservice -cfg histogram.toml
## Beispiel:
PS C:\temp> /daten/go/bin\histogram.exe -cfg /daten/go/src\gitlab.switch.ch\memoriav\memobase-2020\services\histogram\histogram.toml -img act_binde.png
......@@ -24,3 +30,21 @@ basierend auf einer Colormap, welche im Konfigurationsfile definiert wird.
"Thistle": 226,
"Violet": 104
}
## Webservice request
### Histogram
#curl http://localhost:83/histogram/mnt/c/temp/Icon_pudelrudel_video.png
{"Brown":600,"HotPink":401,"NeonPink":971,"Pink":62,"Plum":5225,"Scarlet":2034,"VioletRed":707}
### ValidateVideo
#curl http://localhost:83/validateav/mnt/c/temp/pudel.mp4
{"status":"error","message":""}
#curl http://localhost:83/validateav/mnt/c/Users/juergen.enge/Downloads/Tony%20Conrad%27s%20Art%20Show%20at%20Greene%20Naftali%20Gallery%20-%20Art%20Show.webm
{"status":"ok","message":"[matroska,webm @ 0x7fffca78dc40] Element at 0x951cfd ending at 0x951d0e exceeds containing master element ending at 0x951cf1"}
### ValidateImage
#curl http://localhost:83/validateimage/mnt/c/daten/go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram/parliamentdefect.jpg
{"status":"error","message":"identify: Premature end of JPEG file `/mnt/c/daten/go/src/gitlab.switch.ch/memoriav/memobase-2020/services/histogram/parliamentdefect.jpg' @ warning/jpeg.c/JPEGWarningHandler/352."}
\ No newline at end of file
color.png

460 Bytes | W: | H:

color.png

460 Bytes | W: | H:

color.png
color.png
color.png
color.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -29,7 +29,7 @@ wsl = true # true, if executable is within linux subsystem on windows
colors = 10 # Anzahl der Farben im Histogramm
resize = "100x100!"
[colormap]
[histogram.colormap]
AliceBlue = "#F0F8FE"
AntiqueWhite = "#FAEBD7"
Aqua = "#00FFFF"
......
......@@ -80,9 +80,14 @@ func (h *Histogram) Exec(file string, args ...interface{}) (interface{}, error)
cmd.Stdout = &out
if err := cmd.Run(); err != nil {
exiterr, ok := err.(*exec.ExitError)
if ok && exiterr.ExitCode() == 1 {
} else {
outStr := out.String()
return colors, emperror.Wrapf(err, "error executing (%s %s): %v", cmdfile, cmdparam, outStr)
}
}
data := out.String()
// 44391: ( 0, 0, 0, 0) #00000000 none
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment