Req #66887 [Com]: imagescale - poor quality of scaled image

From: Date: Wed, 12 Mar 2014 13:54:13 +0000
Subject: Req #66887 [Com]: imagescale - poor quality of scaled image
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184752@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66887&edit=1

 ID:                 66887
 Comment by:         remi@php.net
 Reported by:        mruz at poczta dot onet dot pl
 Summary:            imagescale - poor quality of scaled image
 Status:             Feedback
 Type:               Feature/Change Request
 Package:            GD related
 Operating System:   openSUSE 13.1
 PHP Version:        5.5.10
 Block user comment: N
 Private report:     N

 New Comment:

Can you try with 
    imagesetinterpolation($oryginal, $alg);
    $img = imagescale($oryginal, 600, 400);

$alg option of imagescale is ignored (yes, this is a "goto fail;" bug)

It seems IMG_BILINEAR_FIXED produce this bad quality image.
IMG_BICUBIC_FIXED and IMG_NEAREST_NEIGHBOUR seems to work better.


Previous Comments:
------------------------------------------------------------------------
[2014-03-12 11:18:16] mruz at poczta dot onet dot pl

Bundled, x86_64

------------------------------------------------------------------------
[2014-03-12 11:12:15] pajoye@php.net

Looks like a bug.

Which gd do you use? Bundled or system? See phpinfo

I also need to know which architecture you use (cpu)

------------------------------------------------------------------------
[2014-03-12 11:02:25] mruz at poczta dot onet dot pl

Sorry, http://mruz.pl/test/tmp0.jpg , available file
names: tmp[0-20].jpg

------------------------------------------------------------------------
[2014-03-12 10:55:56] pajoye@php.net

and which result do you get? link pls

------------------------------------------------------------------------
[2014-03-12 10:37:20] mruz at poczta dot onet dot pl

$algs = [
IMG_BELL,
IMG_BESSEL,
IMG_BICUBIC,
IMG_BICUBIC_FIXED,
IMG_BILINEAR_FIXED,
IMG_BLACKMAN,
IMG_BOX,
IMG_BSPLINE,
IMG_CATMULLROM,
IMG_GAUSSIAN,
IMG_GENERALIZED_CUBIC,
IMG_HERMITE,
IMG_HAMMING,
IMG_HANNING,
IMG_MITCHELL,
IMG_POWER,
IMG_QUADRATIC,
IMG_SINC,
IMG_NEAREST_NEIGHBOUR,
IMG_WEIGHTED4,
IMG_TRIANGLE,
];

foreach ($algs as $key => $alg) {
    $img = imagescale($oryginal, 600, 400, $alg);
    imagejpeg($img, 'tmp'.$key.'.jpg', 90);
    echo '<img src="tmp'.$key.'.jpg" /><br />';
}

All images are the same...

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=66887


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66887&edit=1


Thread (15 messages)

« previous php.bugs (#184752) next »