note 119620 added to function.imagecropauto

From: Date: Mon, 18 Jul 2016 23:49:13 +0000
Subject: note 119620 added to function.imagecropauto
Groups: php.notes 
Request: Send a blank email to php-notes+get-206050@lists.php.net to get a copy of this message
In some cases the use of the IMG_CROP_WHITE or IMG_CROP_BLACK does not work. The function returns FALSE. It is best to use the IMG_CROP_THRESHOLD mode and specify the color in fourth argument as in the example below : <?php $original_img = imagecreatefromjpeg($image_path); // Use this : $cropped_img_white = imagecropauto($original_img , IMG_CROP_THRESHOLD, null, 16777215); // Rather than : $cropped_img_white = imagecropauto($original_img , IMG_CROP_WHITE); // AND // Use this : $cropped_img_black = imagecropauto($original_img , IMG_CROP_THRESHOLD, null, 0); // Rather than : $cropped_img_black = imagecropauto($original_img , IMG_CROP_BLACK); ?> ---- Server IP: 72.52.91.14 Probable Submitter: 82.226.204.111 ---- Manual Page -- http://php.net/manual/en/function.imagecropauto.php Edit -- https://master.php.net/note/edit/119620 Del: integrated -- https://master.php.net/note/delete/119620/integrated Del: useless -- https://master.php.net/note/delete/119620/useless Del: bad code -- https://master.php.net/note/delete/119620/bad+code Del: spam -- https://master.php.net/note/delete/119620/spam Del: non-english -- https://master.php.net/note/delete/119620/non-english Del: in docs -- https://master.php.net/note/delete/119620/in+docs Del: other reasons-- https://master.php.net/note/delete/119620 Reject -- https://master.php.net/note/reject/119620 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206050) next »