Skip to content

Commit

Permalink
Fix bug in DecodeCommands - spatial scaling was always forced
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Sep 15, 2017
1 parent 1b68402 commit fe5b5b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Imageflow/Fluent/DecodeCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace Imageflow.Fluent
{
[Flags]
public enum DecderDownscalingMode
{
/// <summary>
Expand Down Expand Up @@ -35,15 +34,15 @@ public class DecodeCommands

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

public bool DiscardColorProfile { get; set; } = false;
public bool DiscardColorProfile { get; set; }

public object[] ToImageflowDynamic()
{
object downscale = DownscaleHint.HasValue ? new {
jpeg_downscale_hints = new {
width = DownscaleHint.Value.Width,
height = DownscaleHint.Value.Height,
scale_luma_spatially = (DownscalingMode | DecderDownscalingMode.SpatialLumaScaling) > 0,
scale_luma_spatially = DownscalingMode == DecderDownscalingMode.SpatialLumaScaling || DownscalingMode == DecderDownscalingMode.GammaCorrectSpatialLumaScaling,
gamma_correct_for_srgb_during_spatial_luma_scaling = DownscalingMode == DecderDownscalingMode.GammaCorrectSpatialLumaScaling
}
}: null;
Expand Down

0 comments on commit fe5b5b4

Please sign in to comment.