Comments (7)
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.
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.
Currently there is no easy way to only resize on width or height. That would need further coding.
from bulletproof.
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.
@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.
@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.
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)
- iphone upload HOT 2
- How to delete existing (old) file while update? HOT 8
- Minor improvements HOT 2
- Packagist version outdated? Util functions not found thru namespace? And other bugs. HOT 2
- How do i upload multiple image, rename and create thumbnail HOT 4
- File upload not working in linux server HOT 2
- How to Save in JPG (instead of JPEG)? HOT 4
- Svg upload ? HOT 2
- Bulletproof - change image that was uploaded HOT 9
- Upsizing not working HOT 7
- Error! directory 'bulletproof' could not be created
- Readme examples are referencing wrong methods (setLocation is now setStorage ) HOT 4
- Uploading Image From a URL HOT 1
- The README.md shows "setLocation" as a valid function, when said function has appearently been renamed to "setStorage" HOT 1
- Dependency Dashboard
- Constant 'FILTER_SANITIZE_STRING' is deprecated HOT 2
- setName fails to work... HOT 1
- Image format error HOT 9
- Object of class UnwindExit could not be converted to string HOT 3
- PHP Deprecated: Return type of Bulletproof\Image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bulletproof.