Skip to content

Commit fe5b5b4

Browse files
committed
Fix bug in DecodeCommands - spatial scaling was always forced
1 parent 1b68402 commit fe5b5b4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Imageflow/Fluent/DecodeCommands.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace Imageflow.Fluent
77
{
8-
[Flags]
98
public enum DecderDownscalingMode
109
{
1110
/// <summary>
@@ -35,15 +34,15 @@ public class DecodeCommands
3534

3635
public DecderDownscalingMode DownscalingMode { get; set; } = DecderDownscalingMode.Unspecified;
3736

38-
public bool DiscardColorProfile { get; set; } = false;
37+
public bool DiscardColorProfile { get; set; }
3938

4039
public object[] ToImageflowDynamic()
4140
{
4241
object downscale = DownscaleHint.HasValue ? new {
4342
jpeg_downscale_hints = new {
4443
width = DownscaleHint.Value.Width,
4544
height = DownscaleHint.Value.Height,
46-
scale_luma_spatially = (DownscalingMode | DecderDownscalingMode.SpatialLumaScaling) > 0,
45+
scale_luma_spatially = DownscalingMode == DecderDownscalingMode.SpatialLumaScaling || DownscalingMode == DecderDownscalingMode.GammaCorrectSpatialLumaScaling,
4746
gamma_correct_for_srgb_during_spatial_luma_scaling = DownscalingMode == DecderDownscalingMode.GammaCorrectSpatialLumaScaling
4847
}
4948
}: null;

0 commit comments

Comments
 (0)