Open Source Projects
This is the documentation of the DYReImage image resizing project.
It is an image resizing open source project. You can use it to create thumbnails.
You can download the latest release of the project from its GitHub repository.
If you want to clone the project the using the follwing command in the terminal.
$ git clone https://github.com/yusufshakeel/dyreimage-php.git
You can also use bower to install the project. Run the following command to get the project.
$ bower install dyreimage-php
After you download the file the project structure will look something like the following.
We are interested in the src/DYReImage directory. This holds the code needed to perform image resize.
Lets say we have a project myproject in which we want to use DYReImage.
So, we will include the DYReImage directory which is inside the src directory in our project.
Our project will looking like the following.
We have DYReImage directory and its related files and directories. Then we have an image directory which holds sample.jpeg file.
And we also have an index.php file which is empty at the moment.
In order to resize an image we have to set three variables and pass it to DYReImage.
$option = array(
"height" => 200,
"width" => "auto",
"quality" => 80
Following are the values allowed for the 3 option parameters.
This is an integer value. Range: 0 < x <= 100.
In the next tutorial we will learn to resize the sample.jpeg file using DYReImage.
Have fun learning :-)
Copyright © 2014 - 2018 DYclassroom. All rights reserved.
rendered in 0.0508 sec