Giter VIP home page Giter VIP logo

Comments (3)

ctessier avatar ctessier commented on July 19, 2024

Hi @erayusta

I am not sure I understand your issue.
Just note that the resize method doesn't define the size of the crop box, but the size to which the image will be resized during upload (keeping the ratio).

If you want to specify a ratio for the crop box, you can give the croppable method a first parameter.

Hope this helps.

from nova-advanced-image-field.

erayusta avatar erayusta commented on July 19, 2024

Thank you for response. I understood you correctly.

Actually, I want to custom size for the crop box.

from nova-advanced-image-field.

ctessier avatar ctessier commented on July 19, 2024

Actually, I want to custom size for the crop box.

You can give it a ratio. The package uses https://github.com/fengyuanchen/cropperjs and cropperjs doesn't allow to pass an arbitrary width and height for the crop box.

I suggest you pass a ratio and define your ideal width or height in the resize method. Like this, your final image will have the right size, and your user will still be able to decide which part of the image to crop in case she wants to shrink the selection for instance.

As an example, ->croppable(16/9)->resize(400) will result in an image of 400px by 225px.

from nova-advanced-image-field.

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.