This commit is contained in:
Ryan Oldenburg 2022-05-16 18:18:30 -05:00
parent 34fa05da97
commit 50090a8800

View file

@ -892,15 +892,12 @@ proc buildImage(state: var DecoderState): Image =
cb.unsafe[x, y],
cr.unsafe[x, y],
)
elif state.components.len == 1:
let
cy = state.components[0].channel
for y in 0 ..< state.imageHeight:
for x in 0 ..< state.imageWidth:
result.unsafe[x, y] = grayScaleToRgbx(
cy.unsafe[x, y],
)
result.unsafe[x, y] = grayScaleToRgbx(cy.unsafe[x, y])
else:
failInvalid()