|
@@ -11,6 +11,7 @@ func main() {
|
|
|
|
|
|
|
|
brotherIP := flag.String("a", "192.168.0.157", "IP address of the Brother scanner")
|
|
brotherIP := flag.String("a", "192.168.0.157", "IP address of the Brother scanner")
|
|
|
color := flag.String("c", "CGRAY", "Color mode of the scan (CGRAY, TEXT)")
|
|
color := flag.String("c", "CGRAY", "Color mode of the scan (CGRAY, TEXT)")
|
|
|
|
|
+ debug := flag.Bool("d", false, "Enable debug mode - save .rawbytes and .raw file")
|
|
|
rawinput := flag.String("i", "", "raw input file to parse instead of socket")
|
|
rawinput := flag.String("i", "", "raw input file to parse instead of socket")
|
|
|
name := flag.String("n", "scan.tiff", "Name of the output file")
|
|
name := flag.String("n", "scan.tiff", "Name of the output file")
|
|
|
resolution := flag.Int("r", 300, "Resolution of the scan")
|
|
resolution := flag.Int("r", 300, "Resolution of the scan")
|
|
@@ -21,13 +22,13 @@ func main() {
|
|
|
HandleError(fmt.Errorf("invalid IP address: %s", *brotherIP))
|
|
HandleError(fmt.Errorf("invalid IP address: %s", *brotherIP))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- rawImages, width, height := Scan(*brotherIP, brotherPort, *resolution, *color, *rawinput)
|
|
|
|
|
|
|
+ rawImages, width, height := Scan(*brotherIP, brotherPort, *resolution, *color, *rawinput, *debug)
|
|
|
|
|
|
|
|
for i, rawImage := range rawImages {
|
|
for i, rawImage := range rawImages {
|
|
|
if i == len(rawImages)-1 {
|
|
if i == len(rawImages)-1 {
|
|
|
- SaveImage(rawImage, width, height, fmt.Sprintf("%s-%d.tiff", *name, i), *color)
|
|
|
|
|
|
|
+ SaveImage(rawImage, width, height, fmt.Sprintf("%s-%d.tiff", *name, i), *color, *debug)
|
|
|
} else {
|
|
} else {
|
|
|
- go SaveImage(rawImage, width, height, fmt.Sprintf("%s-%d.tiff", *name, i), *color)
|
|
|
|
|
|
|
+ go SaveImage(rawImage, width, height, fmt.Sprintf("%s-%d.tiff", *name, i), *color, *debug)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|