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:
CalamitousFelicitousness
2026-04-25 21:44:09 +01:00
parent 47e78cdbab
commit 3c3b0a8c6f
+1
View File
@@ -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: