mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
fix(grading): preserve image .info across grade_image
Image.fromarray returns a fresh PIL image with empty .info, so the source's parameters/UserComment metadata was silently dropped on the grading roundtrip. In the Process tab this caused upscale + color grading to save PNGs without the original generation parameters, while upscale alone (via PIL resize/filter ops that preserve .info) still worked.
This commit is contained in:
@@ -244,6 +244,7 @@ def grade_image(image: Image.Image, params: GradingParams) -> Image.Image:
|
||||
tensor = tensor.clamp(0, 1)
|
||||
arr = (tensor.squeeze(0).permute(1, 2, 0).float().cpu().numpy() * 255).astype(np.uint8)
|
||||
result = Image.fromarray(arr)
|
||||
result.info = image.info.copy() # Image.fromarray drops info; preserve so Process-tab metadata survives grading
|
||||
|
||||
# LUT applied last (CPU, via pillow-lut-tools)
|
||||
if params.lut_cube_file:
|
||||
|
||||
Reference in New Issue
Block a user