ImgCopyResized

ImgCopyResized
€0.00 *

Prices incl. VAT and shipping

Available as instant download

  • HRIT10010
ImgCopyResized  can be embedded as a library into web applications > do first resize, then... more
Product information "ImgCopyResized" PHP Class

A reliable and extendable PHP method for img cropping.


Community-Edition

The Community-based Version with the basic functions.

ImgCopyResized  can be embedded as a library into web applications > do first resize, then crop image to fix width and height without losing dimension ratio in a user-friendly and simple way.

Horizontal or landscape format, cut always either from right side or from bottom to get final width and height without stretching. Save original width and generated thumbnail in a web comfort jpg format.

Sketch of DD_ImgCopyResized->generateThumbnail() method

+------ $final_width-----+--------$org_X---------+
|                        |                       |
|                        |                       |
$final_height            |                     $org_Y
|                        |                       |
|                        |                       |
|                        |                       |
|       $thumbnail       |       $src_image      |
|   (Resampled image)    |    (Original image)   |
|                        |                       |
|                        |                       |
|                        |                       |
|                        |                       |
+------------------------+                       |
|                                                |
|                                                |
+------------------------------------------------+

Source: http://php.net/manual/de/function.imagecopyresampled.php#112742

The desired storage location, final height, final width, quality, and
the image file in .jpg, .gif, or .png format can be included as a parameter in the method.

The following steps are executed by the function on the basis of the transferred parameters:

  1. Check of minimum size, check of image format, and security checks.
  2. The original image is moved/saved to the specified storage location.
  3. The image is scaled to the specified final height or width (so that the final height or width is not exceeded and there is no loss in dimension).
  4. The image is cropped either from the right or from the bottom.
  5. The transparent background is filled white.
  6. Finally the thumbnail is saved in a web comfort jpg format by this function, and the storage location of the thumbnail is returned as a parameter for further processing (return value).

This method should work and run on a wide range of php servers
and works without additional php extensions!

 

Generated file examples

1872org_image.jpg (Original image)
1872_image.jpg (Thumbnail)

Community-Edition Support, we only give support indirectly. Only issue support via GitHub and the community!


Direct support for "ImgCopyResized"