Git Product home page Git Product logo

Comments (6)

flokosiol avatar flokosiol commented on July 23, 2024

Thanks for your feedback. This should be possible and I'll check it out.

But what do you think should happen, if only one dimension (width or height) is larger than the original?

// original 800px x 800px

->focusCrop(1200,600)

Possible results

  1. Crop only the height: 800px x 600px
  2. Crop to desired reatio: 800px x 400px
  3. Don't crop at all: 800px x 800px

from kirby-focus.

movingwater avatar movingwater commented on July 23, 2024

I would prefer to crop to the desired ratio (2).

And thanks alot for your effort and fast response.

from kirby-focus.

SimonWpt avatar SimonWpt commented on July 23, 2024

Crop means crop, not CropAndScale. For this reason I would select 1 :)

from kirby-focus.

flokosiol avatar flokosiol commented on July 23, 2024

I also prefer 1, but I will check how the Kirby crop() method handles this.

from kirby-focus.

flokosiol avatar flokosiol commented on July 23, 2024

Alright, Kirby crop() makes an upscale to match the larger value and then crops the image to the final dimensions. As far as I can see, there's no possibility to prevent this upscale.

Exactly the same like focusCrop() works at the moment.

from kirby-focus.

flokosiol avatar flokosiol commented on July 23, 2024

I came back this issue after quite a long time and I think I will stick to the current behavior, because it's the same way the Kirby crop() method works. Let's keep things consistent 😉

from kirby-focus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.