Skip to content

Commit a964313

Browse files
committed
Prevent stdout spam when exporting DZI files
1 parent 88507af commit a964313

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

bin/stitch/dzi.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (d DZI) ExportDZITiles(outputDir string) error {
123123
rect = rect.Inset(-d.overlap)
124124
img := stitchedImage.SubStitchedImage(rect)
125125
filePath := filepath.Join(levelBasePath, fmt.Sprintf("%d_%d%s", iX, iY, d.fileExtension))
126-
if err := exportPNG(img, filePath); err != nil {
126+
if err := exportPNGSilent(img, filePath); err != nil {
127127
return fmt.Errorf("failed to export PNG: %w", err)
128128
}
129129

bin/stitch/export-jpeg.go

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import (
1515

1616
func exportJPEG(stitchedImage image.Image, outputPath string) error {
1717
log.Printf("Creating output file %q.", outputPath)
18+
19+
return exportJPEGSilent(stitchedImage, outputPath)
20+
}
21+
22+
func exportJPEGSilent(stitchedImage image.Image, outputPath string) error {
1823
f, err := os.Create(outputPath)
1924
if err != nil {
2025
return fmt.Errorf("failed to create file: %w", err)

bin/stitch/export-png.go

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import (
1515

1616
func exportPNG(stitchedImage image.Image, outputPath string) error {
1717
log.Printf("Creating output file %q.", outputPath)
18+
19+
return exportPNGSilent(stitchedImage, outputPath)
20+
}
21+
22+
func exportPNGSilent(stitchedImage image.Image, outputPath string) error {
1823
f, err := os.Create(outputPath)
1924
if err != nil {
2025
return fmt.Errorf("failed to create file: %w", err)

0 commit comments

Comments
 (0)