Files
s1d3sw1ped 1a69fcfd04 Refactor installation and runner scripts for enhanced usability and security
- Updated the installation script to clarify that production wrappers do not include fixed test secrets, improving user guidance for local testing.
- Modified the jiggablend-manager and jiggablend-runner scripts to remove fixed test configurations, emphasizing the use of local test credentials via `make init-test`.
- Enhanced error handling in the runner script to ensure that an API key is provided, improving security and user feedback.
- Added new flags and options for the runner, including sandboxing capabilities and GPU ray tracing control, enhancing flexibility for users.
- Improved README documentation to reflect changes in usage and configuration, ensuring users have clear instructions for setup and execution.
2026-07-12 10:01:15 -05:00

46 lines
1.3 KiB
Go

package tasks
import (
"fmt"
"os/exec"
"strings"
)
// mergeEXRFiles averages multiple linear EXR renders into one (Monte Carlo accumulation).
func mergeEXRFiles(output string, inputs []string) error {
if len(inputs) == 0 {
return fmt.Errorf("no input EXR files to merge")
}
if len(inputs) == 1 {
return copyFile(inputs[0], output)
}
args := append([]string{}, inputs...)
args = append(args, "-evaluate-sequence", "mean", output)
if path, err := exec.LookPath("magick"); err == nil {
cmd := exec.Command(path, args...)
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("magick merge failed: %w (%s)", err, strings.TrimSpace(string(out)))
}
return nil
}
if path, err := exec.LookPath("convert"); err == nil {
cmd := exec.Command(path, args...)
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("convert merge failed: %w (%s)", err, strings.TrimSpace(string(out)))
}
return nil
}
return fmt.Errorf("ImageMagick (magick or convert) required to merge batched EXR renders")
}
func copyFile(src, dst string) error {
cmd := exec.Command("cp", "-f", src, dst)
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("copy %s to %s: %w (%s)", src, dst, err, strings.TrimSpace(string(out)))
}
return nil
}