Giter VIP home page Giter VIP logo

Comments (7)

samayo avatar samayo commented on June 2, 2024

Hi.

It seems @petervanderdoes was the author of that feature, I merged without much evaluation. Will look more into this, sorry for the delay and any inconvenience.

from bulletproof.

petervanderdoes avatar petervanderdoes commented on June 2, 2024

This shrink(array("width"=>1000, "height"=>1000, "shrinkRatio"=>true)) is the wrong format. it should be
shrink(array("width"=>1000, "height"=>1000), true))

The command is shrink(array(width,height), ratio, upsize)

The ratio can set to true or false depending on whether or not you want to keep the ratio of the photo, defaults to false.
The upsize can be set to true or false depending on whether or not you want to upsize the image if the given width/height is larger than the original image, defaults to true.

from bulletproof.

petervanderdoes avatar petervanderdoes commented on June 2, 2024

Currently there is no easy way to only resize on width or height. That would need further coding.

from bulletproof.

CraigLovelock avatar CraigLovelock commented on June 2, 2024

Currently if I use: shrink(array("width"=>1000, "height"=>1000), true)

That will shrink the image but doesn't keep the ratio. It seems to squash the image so it has a 1000px width but doesn't adjust the height correctly / not at all.

EDIT: Looks like It needs a bit of playing with. After adjusting the height to only 100px the ratio was kept. I will have a good read at the shrink code and get my head around what is happening.

from bulletproof.

petervanderdoes avatar petervanderdoes commented on June 2, 2024

@CraigLovelock
Does it not adjust the height, or does it not correctly adjust it?

What were the original dimensions of the image you wanted to shrink?

from bulletproof.

samayo avatar samayo commented on June 2, 2024

@petervanderdoes I believe @CraigLovelock has asked similar question in detail in SO I agree the ratio resize feature is very important, I will see if I can add a clearer code/example soon

from bulletproof.

petervanderdoes avatar petervanderdoes commented on June 2, 2024

Pull Request #21 allows for resizing by either width or height. If you give the width and set height to NULL the image is resized for the given width and what the new height will be does not matter.

from bulletproof.

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.