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

error message added

parent bca1da60
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/histogram.iml" filepath="$PROJECT_DIR$/.idea/histogram.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
erzeugt mit Hilfe von ImageMagick (convert) ein Histogramm erzeugt mit Hilfe von ImageMagick (convert) ein Histogramm
basierend auf einer Colormap, welche im Konfigurationsfile definiert wird. basierend auf einer Colormap, welche im Konfigurationsfile definiert wird.
Aufruf: ## Installation
`histogram -cfg histogram.toml -img bildchen.jpg ` go get gitlab.switch.ch/memoriav/memobase-2020/services/histogram
\ No newline at end of file go build gitlab.switch.ch/memoriav/memobase-2020/services/histogram
## Start:
histogram -cfg histogram.toml -img bildchen.jpg
\ No newline at end of file
...@@ -98,6 +98,7 @@ func main() { ...@@ -98,6 +98,7 @@ func main() {
config.ImageMagick.Wsl) config.ImageMagick.Wsl)
if err != nil { if err != nil {
log.Panicf("error getting histogram: %v", err) log.Panicf("error getting histogram: %v", err)
return
} }
result := make(map[string]int64) result := make(map[string]int64)
for col, weight := range histogram { for col, weight := range histogram {
...@@ -139,12 +140,7 @@ func getHistogram(convert, resize, remap string, colors int, file string, timeou ...@@ -139,12 +140,7 @@ func getHistogram(convert, resize, remap string, colors int, file string, timeou
cmd.Stdout = &out cmd.Stdout = &out
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
switch e := err.(type) { return result, emperror.Wrapf(err, "error executing (%s %s): %v - %v", cmdfile, cmdparam, out.String(), err)
case *exec.ExitError:
if e.ProcessState.ExitCode() != 1 {
return result, emperror.Wrapf(err, "error executing (%s %s): %v - %v", cmdfile, cmdparam, out.String(), err)
}
}
} }
data := out.String() data := out.String()
......
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