Image_Resize patches (1/2)
| From: | Brent Cook | Date: | Wed, 04 Sep 2002 18:51:09 +0000 |
| Subject: | Image_Resize patches (1/2) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8841@lists.php.net to get a copy of this message | ||
On Fri, 19 Apr 2002, Peter Bowyer wrote:
> OK everyone, a new version is available @
> <http://www.narrow-gauge.co.uk/Image_Transform.tar.gz>.
> Please test and
> report any problems. Then I think it's nearly ready to be committed to
> PEAR :-)
>
> Peter.
Dear Peter,
Image_Transform is a very good package, thanks! I have a few corrective
patches first, for scale(), the test for a percent mark is incorrect and
yields an error notice with PHP 4.3cvs (can't use a negative string
offset). Here is a patch to correct this; I can apply it if you approve.
- Brent
--- Transform.php 2002-09-02 10:05:54.000000000 -0500
+++
/home/busterb/public_html/brentandtiffany.org/www/include/pear/Image/Transform.php
2002-09-04 07:57:45.000000000 -0500
@@ -173,8 +173,7 @@
*/
function scale($size)
{
- $strlen = strlen($size);
- if ($strlen > 0 && '%' == $size{-1}) {
+ if ((strlen($size) > 1) && (substr($size,-1) == '%')) {
return $this->scaleByPercentage(substr($size, 0, -1));
} elseif ($size < 1) {
return $this->scaleByFactor($size);