`min ratio to crop` site setting should respect w/h ratio as defined in markdown

@zogstrip how do you feel about


    if crop
      cropped_width, cropped_height = ImageSizer.crop(original_width, original_height)

      if cropped_width < width
        width = cropped_width
        img["width"] = width
      end

      if cropped_height < height
        height = cropped_height
        img["height"] = height
      end
    end

VS the existing:

https://github.com/discourse/discourse/blob/609625fa180715fcf253dcbe31d6f8daf8f8c5f8/lib/cooked_post_processor.rb#L324-L328

It is certainly less surprising than the current behavior and would make @awesomerobot happy, only real annoyance I can see is that this test is very very very mocky.

https://github.com/discourse/discourse/blob/609625fa180715fcf253dcbe31d6f8daf8f8c5f8/spec/components/cooked_post_processor_spec.rb#L546-L572

If you like feel free to commit.

7 Likes