anchor.diff:      {ResizeWidth,ResizeHeight,CropArgs} = calc_size(ReqWidth, ReqHeight, ImageWidth, ImageHeight, CropPar, Orientation),
       Filters2   = [  {make_image, Mime},
                       {correct_orientation, Orientation},
  -                    {resize, ResizeWidth, ResizeHeight}, 
  +                    {resize, ResizeWidth, ResizeHeight, is_enabled(upscale, Filters)}, 
                       {crop, CropArgs},
                       {colorspace, "RGB"} | Filters1],
       Filters2b = case {CropArgs,is_enabled(extent, Filters)} of
  
positive.code:     {Width, Height, []};
  filter2arg({height, _}, Width, Height) ->
      {Width, Height, []};
  filter2arg({resize, EndWidth, EndHeight}, Width, Height) when Width < EndWidth andalso Height < EndHeight ->
      % Prevent scaling up, perform an extent instead
      GArg = "-gravity West",
      EArg = ["-extent ", integer_to_list(EndWidth),$x,integer_to_list(EndHeight)],
      % Still thumbnail to remove extra info from the image
      RArg = ["-thumbnail ", z_utils:os_escape([integer_to_list(EndWidth),$x,integer_to_list(EndHeight),$!])],
      {EndWidth, EndHeight, [GArg, 32, EArg, 32, RArg]};
  filter2arg({extent, EndWidth, EndHeight}, Width, Height) when EndWidth == undefined orelse EndHeight == undefined ->
      {Width, Height, []};
  filter2arg({extent, EndWidth, EndHeight}, Width, Height) when Width /= EndWidth orelse Height /= EndHeight ->
      GArg = "-gravity Center",
      EArg = ["-extent ", integer_to_list(EndWidth),$x,integer_to_list(EndHeight)],
      {EndWidth, EndHeight, [GArg, 32, EArg]};
  filter2arg({resize, EndWidth, EndHeight}, _Width, _Height) ->
      GArg = "-gravity NorthWest",
      RArg = ["-thumbnail ", z_utils:os_escape([integer_to_list(EndWidth),$x,integer_to_list(EndHeight),$!])],
      {EndWidth, EndHeight, [GArg, 32, RArg]};
  
negative.code: filter2arg({extent, _}, Width, Height) ->
      {Width, Height, []};
  filter2arg({extent, _, _}, Width, Height) ->
      {Width, Height, []};
  filter2arg(upscale, Width, Height) ->
      {Width, Height, []}.
  
  
  