Doc #71423 [Nab]: Misrepresentation
| From: | requinix@php.net | Date: | Thu, 21 Jan 2016 06:40:27 +0000 |
| Subject: | Doc #71423 [Nab]: Misrepresentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13134@lists.php.net to get a copy of this message | ||
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: Not a bug
Type: Documentation Problem
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:
I don't really know. But https://en.wikipedia.org/wiki/Image_scaling
looks interesting.
Previous Comments:
------------------------------------------------------------------------
[2016-01-21 05:04:33] xxalfa at gmail dot com
The other function (imagecopyresampled), then I'll probably have to use unfortunately.
That an interpolation algorithm is used, it is now clear to me, only in what scenarios is something
used?
------------------------------------------------------------------------
[2016-01-20 18:48:21] requinix@php.net
> 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.
------------------------------------------------------------------------
[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