Thumb Library



( ZN >= 3.0.0 )

Cutting, cropping, shrinking, etc. are done on the pictures.

 

 

# Methods


String create ( String $ path = NULL )
this path ( String $ file )
this quality ( Int $ quality )
this crop ( Int $ x , Int $ y )
this size ( Int $ width , Int $ height )
this resize ( Int $ width , Int $ height )
this prosize ( Int $ width , Int $ height )

 

 

# Create ( ZN> = 3.0.0 )


The methods that are configured with the method are used to complete the resizing process.

Parameters
String $ path = NULL Resmin is used to indicate the path. Thumb :: path () is an alternative to the method.
return String
Use of
echo Thumb::path(FILES_DIR . 'images/wallpaper.jpg') 
          ->crop(100, 200) 
          ->resize(300, 200) 
          ->create();
https: //localhost/develop/projects/example/resources/files/images/thumbs/wallpaper-100x200px-300x200size.jpg
$thumb = Thumb::crop(100, 200)
              ->resize(300, 200)
              ->create(FILES_DIR . 'images/wallpaper.jpg');

echo Html::image($thumb);

 

 

# Path ( ZN >= 3.0.0 )


It is specified in which image file the resizing operation will be performed.

Parameters
String $ path Resmin is used to indicate the path.
return this
Use of
echo Thumb::path(FILES_DIR . 'images/wallpaper.jpg')
          ->crop(100, 200)
          ->resize(300, 200)
          ->create();
https: //localhost/develop/projects/example/resources/files/images/thumbs/wallpaper-100x200px-300x200size.jpg

 

 

# Quality ( ZN >= 3.0.0 )


Used to specify the quality of the newly created image. It is a value between 0 and 100 .

Parameters
Int $ quality Quality quantity.
return this
Use of
$thumbPath = Thumb::path(FILES_DIR . 'images/wallpaper.jpg')
                  ->quality(80)
                  ->crop(100, 200)
                  ->resize(300, 200)
                  ->create();

echo Html::image($thumbPath);
$thumb = Thumb::quality(2)
              ->crop(600, 350)
              ->size(300, 300)
              ->create(FILES_DIR . 'images/wallpaper.jpg');

echo Html::image($thumb);

 

 

# Crop ( ZN >= 3.0.0 )


Used to indicate that the resizing process will start from the pixels in the original image.

Parameters
Int $ x In the horizontal plane, the starting point will start with the pixel.
Int $ y The vertical plane will begin with the number of pixels.
return this
Use of
echo Thumb::path(FILES_DIR . 'images/wallpaper.jpg') 
          ->quality(80)
          ->crop(100, 200) 
          ->resize(300, 200) 
          ->create();

 

 

# Size ( ZN >= 3.0.0 )


Used to adjust the width and height of the cropped image.

Parameters
Int $ width Width.
Int $ height Height.
return this
Use of
$thumb = Thumb::quality(80)
              ->crop(600, 300)
              ->size(300, 300)
              ->create(FILES_DIR . 'images/wallpaper.jpg');

echo Html::image($thumb);

 

 

# Resize ( ZN >= 3.0.0 )


Used to adjust the image resize width and height.

Parameters
Int $ width Width.
Int $ height Height.
return this
Use of
$thumb = Thumb::quality(80)
              ->resize(200, 400)
              ->create(FILES_DIR . 'images/wallpaper.jpg');

echo Html::image($thumb);

 

 

# Prosize ( ZN >= 3.0.0 )


Used to scale the picture proportionally.

Parameters
Int $ width Width.
Int $ height Height.
return this
Use of
$thumb = Thumb::quality(80)
              ->crop(100, 200)
              ->prosize(0, 200)
              ->create(FILES_DIR . 'images/wallpaper.jpg');

echo Html::image($thumb);
$thumb = Thumb::quality(80)
              ->crop(100, 200)
              ->prosize(200)
              ->create(FILES_DIR . 'images/wallpaper.jpg');

echo Html::image($thumb);

 

 

# Images Derived from the Original Picture


Each of the above formatting and sizing operations produces a new image from the original image. You show the original file path as the path, and the library fetches the image according to the specified properties.