New Feature: Automatic Image Version Creation
Posted by Nils on 15 December 2008
Finally, a long wanted feature found it's way into the repository. You can now create scaled image version on the fly, e.g. for teasing images.
Usage ist quite simple. First get an Image object and then try to select a version:
$myImg->selectVersionOrCreate("teaser",120,100);
If an image version name "teaser" is available, the version simply gets selected.
Otherwise a new version with the image dimension 120x100 is created and stored under the name "teaser". So on the next call no new image operation is necessary.
There's another side effect. If you dislike the automatic generated version, you may edit it yourself in the mediabase. As long as the version is named "teaser" it will get selected. So you don't loose your capability to control the images on your website.
selectVersionOrCreate ($name,$x,$y,$method = 5, $quality = 85,$sharpening = 1)
There are some options to influence the image creation. You can determine the jpeq quality (it's always a jpeg), sharpening and creation method (e.g. fixed size or fixed target frame).
Since the parameters are most likely to be changed or expanded, check the API doc for current behaviour:
Post your comment
Recent Blog Posts
- Finally Multibyte - Phenotype 3.0
- Phenotype 2.9 explained
- Integration of PHPIDS (PHP-Intrusion Detection System)
- New Release: Phenotype 2.8 Ready for Download
- Restart: New Phenotype Website Live
- Phenotype worth: 2 Million $
- New Feature: Automatic Image Version Creation
- Additional smartURL variable: smartPATH