Skip to content

Commit

Permalink
yet another typo
Browse files Browse the repository at this point in the history
  • Loading branch information
samayo committed Aug 19, 2015
1 parent cac1346 commit e538b3b
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions src/utils/README.md
Expand Up @@ -16,12 +16,12 @@ require 'src/utils/func.image-crop.php';

// call the function and pass the right arguments.
$crop = Bulletproof\crop(
'images/my-car.jpg', // full image path
'jpg', // the mime type of your image
100, // the original image width
200, // the original image height
50, // the new image width
25 // the new image height.
'images/my-car.jpg', // full image path
'jpg', // the mime type of your image
100, // the original image width
200, // the original image height
50, // the new image width
25 // the new image height.
);
// now 'images/my-car.jpg' is cropped to 50x25 pixels.
?>
Expand All @@ -39,30 +39,31 @@ require "src/utils/func.image-resize.php";

$image = new Bulletproof\Image($_FILES);

if($image["picture"] && $image->upload()){

if($upload){
$resize = Bulletproof\resize(
$image->getFullPath(),
$image->getMime(),
$image->getWidth(),
$image->getHeight(),
50,
50
if($image["picture"]){
$upload = $image->upload();

if($upload){
$resize = Bulletproof\resize(
$image->getFullPath(),
$image->getMime(),
$image->getWidth(),
$image->getHeight(),
50,
50
);
}
}
}
```
The `resize()` method supports resizing by ratio, checkout the file for more.
The `crop()` method supports resizing by ratio, checkout the file for more.

#### Croping
You can crop images the same way.
```php
// include bulletproof and the crop function.
require "src/utils/func.image-crop.php";
// assuming image is uploaded.
if($upload){
$resize = Bulletproof\resize(
$crop = Bulletproof\crop(
$upload->getFullPath(),
$upload->getMime(),
$upload->getWidth(),
Expand Down Expand Up @@ -108,4 +109,4 @@ LICENSE
Check the main [bulletproof][bulletproof] page for the license.


[bulletproof]: http://github.com/samayo/bulletproof
[bulletproof]: http://github.com/samayo/bulletproof

0 comments on commit e538b3b

Please sign in to comment.