-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1025 from dreamsxin/image_class
Add Image class
- Loading branch information
Showing
15 changed files
with
3,641 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
/* | ||
+------------------------------------------------------------------------+ | ||
| Phalcon Framework | | ||
+------------------------------------------------------------------------+ | ||
| Copyright (c) 2011-2013 Phalcon Team (http://www.phalconphp.com) | | ||
+------------------------------------------------------------------------+ | ||
| This source file is subject to the New BSD License that is bundled | | ||
| with this package in the file docs/LICENSE.txt. | | ||
| | | ||
| If you did not receive a copy of the license and are unable to | | ||
| obtain it through the world-wide-web, please send an email | | ||
| to license@phalconphp.com so we can send you a copy immediately. | | ||
+------------------------------------------------------------------------+ | ||
| Authors: Andres Gutierrez <andres@phalconphp.com> | | ||
| Eduar Carvajal <eduar@phalconphp.com> | | ||
+------------------------------------------------------------------------+ | ||
*/ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
|
||
#include "php.h" | ||
#include "php_phalcon.h" | ||
#include "phalcon.h" | ||
|
||
#include "Zend/zend_operators.h" | ||
#include "Zend/zend_exceptions.h" | ||
#include "Zend/zend_interfaces.h" | ||
|
||
#include "kernel/main.h" | ||
#include "kernel/memory.h" | ||
|
||
/** | ||
* Phalcon\Image | ||
* | ||
* Image manipulation support. Allows images to be resized, cropped, etc. | ||
* | ||
*<code> | ||
* $image = new Phalcon\Image\Adapter\GD("upload/test.jpg"); | ||
* $image->resize(200, 200); | ||
* $$image->save(); | ||
*</code> | ||
*/ | ||
|
||
|
||
/** | ||
* Phalcon\Image initializer | ||
*/ | ||
PHALCON_INIT_CLASS(Phalcon_Image){ | ||
|
||
PHALCON_REGISTER_CLASS(Phalcon, Image, image, NULL, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); | ||
|
||
// Resizing constraints | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("NONE"), 1 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("WIDTH"), 2 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("HEIGHT"), 3 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("AUTO"), 4 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("INVERSE"), 5 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("PRECISE"), 6 TSRMLS_CC); | ||
|
||
// Flipping directions | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("HORIZONTAL"), 11 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("VERTICAL"), 12 TSRMLS_CC); | ||
|
||
// Driver: GD, ImageMagick, etc | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("GD"), 21 TSRMLS_CC); | ||
zend_declare_class_constant_long(phalcon_image_ce, SL("IMAGICK"), 22 TSRMLS_CC); | ||
|
||
return SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
/* | ||
+------------------------------------------------------------------------+ | ||
| Phalcon Framework | | ||
+------------------------------------------------------------------------+ | ||
| Copyright (c) 2011-2013 Phalcon Team (http://www.phalconphp.com) | | ||
+------------------------------------------------------------------------+ | ||
| This source file is subject to the New BSD License that is bundled | | ||
| with this package in the file docs/LICENSE.txt. | | ||
| | | ||
| If you did not receive a copy of the license and are unable to | | ||
| obtain it through the world-wide-web, please send an email | | ||
| to license@phalconphp.com so we can send you a copy immediately. | | ||
+------------------------------------------------------------------------+ | ||
| Authors: Andres Gutierrez <andres@phalconphp.com> | | ||
| Eduar Carvajal <eduar@phalconphp.com> | | ||
+------------------------------------------------------------------------+ | ||
*/ | ||
|
||
extern zend_class_entry *phalcon_image_ce; | ||
|
||
PHALCON_INIT_CLASS(Phalcon_Image); |
Oops, something went wrong.