mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-22 21:17:33 +00:00
Prevent stdout spam when exporting DZI files
This commit is contained in:
parent
88507af167
commit
a96431361f
@ -123,7 +123,7 @@ func (d DZI) ExportDZITiles(outputDir string) error {
|
||||
rect = rect.Inset(-d.overlap)
|
||||
img := stitchedImage.SubStitchedImage(rect)
|
||||
filePath := filepath.Join(levelBasePath, fmt.Sprintf("%d_%d%s", iX, iY, d.fileExtension))
|
||||
if err := exportPNG(img, filePath); err != nil {
|
||||
if err := exportPNGSilent(img, filePath); err != nil {
|
||||
return fmt.Errorf("failed to export PNG: %w", err)
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,11 @@ import (
|
||||
|
||||
func exportJPEG(stitchedImage image.Image, outputPath string) error {
|
||||
log.Printf("Creating output file %q.", outputPath)
|
||||
|
||||
return exportJPEGSilent(stitchedImage, outputPath)
|
||||
}
|
||||
|
||||
func exportJPEGSilent(stitchedImage image.Image, outputPath string) error {
|
||||
f, err := os.Create(outputPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create file: %w", err)
|
||||
|
@ -15,6 +15,11 @@ import (
|
||||
|
||||
func exportPNG(stitchedImage image.Image, outputPath string) error {
|
||||
log.Printf("Creating output file %q.", outputPath)
|
||||
|
||||
return exportPNGSilent(stitchedImage, outputPath)
|
||||
}
|
||||
|
||||
func exportPNGSilent(stitchedImage image.Image, outputPath string) error {
|
||||
f, err := os.Create(outputPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create file: %w", err)
|
||||
|
Loading…
Reference in New Issue
Block a user