Most recent edit on 2007-09-26 12:25:43 by GasperKozak [removed SvnOnly tag]
Additions:
Starting with WideImage 1.0 beta, support for mime-type is added:
CategoryDocApi
Deletions:
(SvnOnly) As of svn r25∞, support for mime-type is added:
CategoryDocApi CategoryDocSvn
Edited on 2007-08-06 12:15:13 by GasperKozak
Additions:
CategoryDocApi CategoryDocSvn
Deletions:
CategoryDocApi
Edited on 2007-08-06 12:14:11 by GasperKozak [tagged svnonly]
Additions:
(SvnOnly) As of svn r25∞, support for mime-type is added:
Deletions:
As of svn r25∞, support for mime-type is added:
Edited on 2007-08-06 12:13:23 by GasperKozak
Additions:
As of svn r25∞, support for mime-type is added:
Format can be a typical image extension (gif, gd, png, jpeg, ...) or a mime-type (image/gif, image/png, image/jpg, image/jpeg, image/pjpeg). GD formats don't have a mime-type.
Deletions:
which is the same as
Note: format can be a typical image extension (gif, gd, png, jpeg, ...) or a mime-type (image/gif, image/png, image/jpg, image/jpeg, image/pjpeg). GD formats don't have a mime-type.
Edited on 2007-08-06 12:10:40 by GasperKozak [mentioned mime-type]
Additions:
which is the same as
$img = wiImage::load('/path/to/a/file/without/extension', 'image/gif');
Note: format can be a typical image extension (gif, gd, png, jpeg, ...) or a mime-type (image/gif, image/png, image/jpg, image/jpeg, image/pjpeg). GD formats don't have a mime-type.
Edited on 2007-03-04 15:44:25 by GasperKozak
Additions:
From a URL
Deletions:
From an URL
Edited on 2007-03-03 11:35:00 by GasperKozak
Additions:
CategoryDocApi
Edited on 2007-03-02 17:12:01 by GasperKozak
Additions:
From a file
From an URL
From a string
From a valid image resource
Deletions:
From a file
From an URL
From a string
From a valid image resource
Edited on 2007-03-02 17:11:35 by GasperKozak
Additions:
This only works if you have allow_url_fopen∞ enabled in your php.ini.
Deletions:
This only works if you have [http://www.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen∞ allow_url_fopen] enabled in your php.ini.
Oldest known version of this page was edited on 2007-03-02 17:01:39 by GasperKozak []
Page view:
Loading images
Loading an image is easy -- you only have to call the wiImage::load() static method and specify the image source, like this:
$img = wiImage::load(...);
Optionally, you can specify the preferred image format:
$img = wiImage::load('image source', 'png');
This method supports these types of image sources:
From a file
$img = wiImage::load('path/to/image.jpg');
WideImage uses the file extension to load the image properly, but you can specify a format as the second paramter, which can be useful if you don't have an extension in your file (for example: a file that was just uploaded doesn't).
$img = wiImage::load('/path/to/a/file/without/extension', 'gif');
From an URL
$img = wiImage::load('http://url.of.an/image.gif');
This only works if you have [
http://www.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen∞ allow_url_fopen] enabled in your php.ini.
You can give the image format as the second parameter.
From a string
$image_binary_data =
file_get_contents('path/to/image.gif');
// or from a database
$image_binary_data =
$row_from_db['image'];
$img = wiImage::
load($image_binary_data);
You can give the image format as the second parameter.
From a valid image resource
$image_handle = imagecreatefromjpeg('path/to/a/pic.jpg');
$img = wiImage::load($image_handle);
This could come useful when working with other image libraries or implementing
WideImage in your existing code.
When you load an image from a resource, the object takes ownership of the handle. See
HandleOwnership for details.
If format is passed as the second parameter, it's ignored.