note 115559 added to function.imagecropauto
| From: | jordie at jordie dot org | Date: | Fri, 15 Aug 2014 16:38:08 +0000 |
| Subject: | note 115559 added to function.imagecropauto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200195@lists.php.net to get a copy of this message | ||
Found the list of IMG_CROP_* constants in the PHP source code:
Essentially this function crops the image from any padded background if the background is a single
standard colour. It will look at columns of pixels first, if a whole column is the same color
that's being searched for, the column (image width) will be cropped. Then the pixel rows will
be analyzed and height cropped.
IMG_CROP_TRANSPARENT - crops out a transparent background
IMG_CROP_BLACK - crops out a black background
IMG_CROP_WHITE - crops out a black background
IMG_CROP_SIDES - Uses the 4 corners of the image to attempt to detect the background to crop
IMG_CROP_THRESHOLD - Crop an image using a given color. The threshold argument defines the
tolerance to be used while comparing the image color and the color to crop. The method used to
calculate the color difference is based on the color distance in the RGB(a) cube.
IMG_CROP_DEFAULT - Attempts to use IMG_CROP_TRANSPARENT and if it fails it falls back to
IMG_CROP_SIDES
----
Server IP: 72.52.91.14
Probable Submitter: 101.164.130.139
----
Manual Page -- http://php.net/manual/en/function.imagecropauto.php
Edit -- https://master.php.net/note/edit/115559
Del: integrated -- https://master.php.net/note/delete/115559/integrated
Del: useless -- https://master.php.net/note/delete/115559/useless
Del: bad code -- https://master.php.net/note/delete/115559/bad+code
Del: spam -- https://master.php.net/note/delete/115559/spam
Del: non-english -- https://master.php.net/note/delete/115559/non-english
Del: in docs -- https://master.php.net/note/delete/115559/in+docs
Del: other reasons-- https://master.php.net/note/delete/115559
Reject -- https://master.php.net/note/reject/115559
Search -- https://master.php.net/manage/user-notes.php