Bug #71423 [Opn->Nab]: Misrepresentation
Edit report at https://bugs.php.net/bug.php?id=71423&edit=1
ID: 71423
Updated by: requinix@php.net
Reported by: xxalfa at gmail dot com
Summary: Misrepresentation
-Status: Open
+Status: Not a bug
Type: Bug
Package: GD related
Operating System: Mac OS X 10.11.2
PHP Version: 7.0.2
Block user comment: N
Private report: N
New Comment:
> BLURRED
Then the default interpolation method (fixed-point bilinear) is not suitable for you. If you
don't need control over interpolation then imagecopyresampled() is generally the best resizing
method.
> THE IMAGE IS SHARP NOW, BUT HAS A BLACK BORDER ON THE LEFT AND BELOW.
The $mode is not a bitmask. IMG_BILINEAR_FIXED | IMG_BICUBIC_FIXED => 3 | 5 => 7 which
corresponds to the (undocumented) "box" method. Use one constant or the other, not both.
Previous Comments:
------------------------------------------------------------------------
[2016-01-20 17:56:50] xxalfa at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.imagescale
---
I would like to use this function, just do not do what I expect.
Test script:
---------------
$old_width = imagesx( $image_resource );
$old_height = imagesy( $image_resource );
$percent = 10;
$new_width = $width * $percent;
$new_height = $height * $percent;
// BLURRED
$new_image_resource = imagescale( $image_resource, $new_width, $new_height );
// THE IMAGE IS SHARP NOW, BUT HAS A BLACK BORDER ON THE LEFT AND BELOW.
$new_image_resource = imagescale( $image_resource, $new_width, $new_height, IMG_BILINEAR_FIXED |
IMG_BICUBIC_FIXED );
// CREATES A CLEAN MAGNIFICATION.
$new_image_resource = imagecreatetruecolor( $new_width, $new_height );
imagecopyresized( $new_image_resource, $image_resource, 0, 0, 0, 0, $new_width, $new_height,
$old_width, $old_height );
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71423&edit=1
Thread (2 messages)