Skip to content

Commit

Permalink
Merge 3.3/release/3.3.3 into 3.3/master
Browse files Browse the repository at this point in the history
  • Loading branch information
enov committed Dec 11, 2014
2 parents 57acf4a + c8d7dc4 commit 4f6ce51
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
composer.lock
vendor/*
koharness_bootstrap.php

18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- composer install --prefer-dist
- vendor/bin/koharness

script:
- cd /tmp/koharness && ./vendor/bin/phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php

notifications:
email: false
6 changes: 6 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Kohana - image processing module

| ver | Stable | Develop |
|-------|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
| 3.3.x | [![Build Status - 3.3/master](https://travis-ci.org/kohana/image.svg?branch=3.3%2Fmaster)](https://travis-ci.org/kohana/image) | [![Build Status - 3.3/develop](https://travis-ci.org/kohana/image.svg?branch=3.3%2Fdevelop)](https://travis-ci.org/kohana/image) |
| 3.4.x | [![Build Status - 3.4/master](https://travis-ci.org/kohana/image.svg?branch=3.4%2Fmaster)](https://travis-ci.org/kohana/image) | [![Build Status - 3.4/develop](https://travis-ci.org/kohana/image.svg?branch=3.4%2Fdevelop)](https://travis-ci.org/kohana/image) |
6 changes: 4 additions & 2 deletions classes/Kohana/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ abstract class Kohana_Image {
const VERTICAL = 0x12;

/**
* @deprecated - provide an image.default_driver value in your configuration instead
* @var string default driver: GD, ImageMagick, etc
*/
public static $default_driver = 'GD';
Expand All @@ -44,8 +45,9 @@ public static function factory($file, $driver = NULL)
{
if ($driver === NULL)
{
// Use the default driver
$driver = Image::$default_driver;
// Use the driver from configuration file or default one
$configured_driver = Kohana::$config->load('image.default_driver');
$driver = ($configured_driver) ? $configured_driver : Image::$default_driver;
}

// Set the class name
Expand Down
1 change: 1 addition & 0 deletions classes/Kohana/Image/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ protected function _save_function($extension, & $quality)
switch (strtolower($extension))
{
case 'jpg':
case 'jpe':
case 'jpeg':
// Save a JPG file
$save = 'imagejpeg';
Expand Down
1 change: 1 addition & 0 deletions classes/Kohana/Image/Imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ protected function _get_imagetype($extension)
switch ($format)
{
case 'jpg':
case 'jpe':
case 'jpeg':
$type = IMAGETYPE_JPEG;
break;
Expand Down
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@
"kohana/core": ">=3.3",
"php": ">=5.3.3"
},
"require-dev": {
"kohana/core": "3.3.*@dev",
"kohana/unittest": "3.3.*@dev",
"kohana/koharness": "*@dev"
},
"suggest": {
"ext-gd": "*"
},
"extra": {
"branch-alias": {
"dev-3.3/develop": "3.3.x-dev",
"dev-3.4/develop": "3.4.x-dev"
}
},
"installer-paths": {
"vendor/{$vendor}/{$name}": ["type:kohana-module"]
}
}
}
8 changes: 8 additions & 0 deletions config/image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php defined('SYSPATH') OR die('No direct script access.');

return array(
// Provide the default driver to use - eg a value of Imagick will use Image_Imagick as the driver class
// If you set a value for this config key, then the Image::$default_driver static variable that was used
// to configure earlier versions will be ignored.
'default_driver' => NULL,
);
21 changes: 19 additions & 2 deletions guide/image/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@ Kohana 3.x provides a simple yet powerful image manipulation module. The [Image]

## Drivers

[Image] module ships with [Image_GD] driver which requires `GD` extension enabled in your PHP installation. This is the default driver. Additional drivers can be created by extending the [Image] class.
[Image] module ships with [Image_GD] driver which requires `GD` extension enabled in your PHP installation, and
[Image_Imagick] driver which requires the `imagick` PHP extension. Additional drivers can be created by extending
the [Image] class.

The [Image_GD] driver is the default. You can change this by providing an `image.default_driver` configuration option
- for example:

~~~
// application/config/image.php
<?php
return array(
'default_driver' => 'Imagick'
);
~~~

[!!] Older versions of Kohana allowed you to configure the driver with the `Image::$default_driver` static variable in
the bootstrap, an extension class, or elsewhere. That variable is now deprecated and will be ignored if you set a
config value.

## Getting Started

Expand All @@ -18,4 +35,4 @@ Kohana::modules(array(
));
~~~

Next: [Using the image module](using).
Next: [Using the image module](using).
8 changes: 8 additions & 0 deletions koharness.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
// Configuration for koharness - builds a standalone skeleton Kohana app for running unit tests
return array(
'modules' => array(
'image' => __DIR__,
'unittest' => __DIR__ . '/vendor/kohana/unittest'
),
);

0 comments on commit 4f6ce51

Please sign in to comment.