mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-18 17:17:31 +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)
|
rect = rect.Inset(-d.overlap)
|
||||||
img := stitchedImage.SubStitchedImage(rect)
|
img := stitchedImage.SubStitchedImage(rect)
|
||||||
filePath := filepath.Join(levelBasePath, fmt.Sprintf("%d_%d%s", iX, iY, d.fileExtension))
|
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)
|
return fmt.Errorf("failed to export PNG: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,11 @@ import (
|
|||||||
|
|
||||||
func exportJPEG(stitchedImage image.Image, outputPath string) error {
|
func exportJPEG(stitchedImage image.Image, outputPath string) error {
|
||||||
log.Printf("Creating output file %q.", outputPath)
|
log.Printf("Creating output file %q.", outputPath)
|
||||||
|
|
||||||
|
return exportJPEGSilent(stitchedImage, outputPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
func exportJPEGSilent(stitchedImage image.Image, outputPath string) error {
|
||||||
f, err := os.Create(outputPath)
|
f, err := os.Create(outputPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create file: %w", err)
|
return fmt.Errorf("failed to create file: %w", err)
|
||||||
|
@ -15,6 +15,11 @@ import (
|
|||||||
|
|
||||||
func exportPNG(stitchedImage image.Image, outputPath string) error {
|
func exportPNG(stitchedImage image.Image, outputPath string) error {
|
||||||
log.Printf("Creating output file %q.", outputPath)
|
log.Printf("Creating output file %q.", outputPath)
|
||||||
|
|
||||||
|
return exportPNGSilent(stitchedImage, outputPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
func exportPNGSilent(stitchedImage image.Image, outputPath string) error {
|
||||||
f, err := os.Create(outputPath)
|
f, err := os.Create(outputPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create file: %w", err)
|
return fmt.Errorf("failed to create file: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user