Comments (4)
Hi, Hengki.
No problem. I guess this library should work as any other library but I didn't try. What do you need?
from imagecow.
can you create the sample implement on CI?
from imagecow.
Hello!
You can create a custom CI library (http://codeigniter.com/user_guide/general/creating_libraries.html) to use imageCow.
Here's an example: https://gist.github.com/3933552
Put imagecow.php, imagecow_loader.php and the source of imageCow in the directory application/libraries/ of CI
The content of imagecow_loader.php was extracted from here: https://github.com/oscarotero/imageCow/blob/master/test/loader.php
Initialize and call the library in your controller:
$this->load->library('imagecow');
$Image = $this->imagecow->get_lib();
Then you can use $Image following the imageCow API
from imagecow.
Thank you, @swas !!
imagecow_loader contains a class to load the imageCow library that uses the PSR-0 standard. If you prefer, you can use this lighter function that makes the same but with less features:
function autoload ($className) {
$className = ltrim($className, '\\');
$fileName = '';
$namespace = '';
if ($lastNsPos = strripos($className, '\\')) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
if (is_file($fileName)) {
require $fileName;
}
}
spl_autoload_register('autoload');
from imagecow.
Related Issues (20)
- New util: create a png from a svg
- Watermark for image HOT 3
- path of multibyte string suport HOT 1
- Automatic cropping for ResizeCrop HOT 1
- Add quality as transform parameter? HOT 2
- Using this "format,jpg" returns Imagick error HOT 1
- Client Hints: example scales images with 2x too big HOT 5
- The crop method '0' is not available for Imagick HOT 3
- Progressive image HOT 2
- add support for data-save header
- The background color of rotated image HOT 7
- PHPStorm doesn't see Imagecow namespace HOT 1
- Imagick add support format detection HOT 4
- Divide by zero when using BALANCED HOT 5
- Providing a binary or a way to get back the command for improved performances HOT 4
- Create the output directory before calling save() HOT 1
- GD save method lacks jpeg quality parameter, image quality is too low HOT 2
- Quality for jpges not changing HOT 9
- (Imagick) Suggestion to allow setting filter type and blur for better resize quality. HOT 2
- Svg to jpg/png error
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 imagecow.