jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Bugs => Topic started by: Nyx on 20.05.2015 15:51:33

Title: Thumbnails - bad png quality - gd library - [Fixed in 3.2.33!!!]
Post by: Nyx on 20.05.2015 15:51:33
Hi,

First, all work fine with my JD Migration  ;)

But I have little Problems.

One of them is png image quality from the Thumbnails generated by the Upload with GD Library.
I have old (from the old JD 1.8 ) tumbs the also are auto generate with JD.
And they are fine.

I test it an 2 Servers, the same Problem.
Maybe the png quality is set to bad? And where I can change this?

I check the code of the "Plupload Script" but I don't find a solution.

With *.jpg is the same.

Is this a Problem from JD or GD Lib?


e.g:

Good:
(http://i57.tinypic.com/2jdhwd4.jpg)


Bad:
(http://i60.tinypic.com/a3nxoh.jpg)


OR:

Orginal:
(http://i59.tinypic.com/20izbb5.jpg)

resize with photoshop:
(http://i59.tinypic.com/345yir5.jpg)

resize with JD / plupload:
(http://i58.tinypic.com/20928o3.jpg)
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Nyx on 20.05.2015 16:05:07
Ok,

It is may be a Problem with Plupload.

There is a big open ticket since Feb 2013!

Bad image quality.

https://github.com/moxiecode/plupload/issues/707
And there is no solution,...

So I must generate per hand all tumbs by photoshop. this is very bad.


The funny thing is, that the good resize photoshop images have the same file size as the bad plupload resize images!


http://www.plupload.com/docs/Image-Resizing-on-Client-Side
Quote
Decrease quality JPEGs only

quality sub-option can be used with other resizing options or without them, since sometimes it might be required to decrease the images size without changing its dimensions. Hence it can be:

resize: {
  width: 100,
  height: 100,
  crop: true,
  quality: 70
}
as well as simply:

resize: {
  quality: 70
}
It is worth to mention once more that this is applicable only to JPEGs, since PNG is lossless format and doesn't understand quality gradations.

so,.. is it may be not the quality... its the resize process?
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Arno on 24.05.2015 22:44:41
Hi Nyx,
i have no idea what for technics Photoshop use to create thumbnails.
So i am not sure that it is useful to compare the results.

You use the Plupload function in the jD backend to upload your images?
When yes, which settings used you in the jD configuration for Plupload (see pic)?


[gelöscht durch Administrator]
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Nyx on 29.05.2015 01:22:35
Hi,

I have no old jdownload system (J 1.5) available.
I'll try to find or install one.

I use Adobe Photoshop with the setting / function "Bicubic"
http://de.wikipedia.org/wiki/Interpolation_(Fotografie)#Bikubische_Interpolation

Sure Plupload can never reach the performance of Photoshop, but the old system upload / Image Reduction tool came close to it.

And yes I Upload over the Joomla backend the Downloads / images.


I don't resize the original image when I upload them. I only need the thumbnails, they should automatically created.

See Pic 2.


[gelöscht durch Administrator]
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Arno on 29.05.2015 08:46:04
Quote...but the old system upload / Image Reduction tool came close to it.
Then should you not use the Plupload function. Use the normal way - via FTP and auto monitoring or create directly a new Download via backend or frontend. Then is used the same thumbnail function as in the old jD series.
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Nyx on 29.05.2015 23:07:28
Hi,

I create always directly a new Download via backend.
I also upload a image to the new download via the backend in the "create new download" process.

The upload images are fine - I don't resize them.
BUT the auto thumbnail form this images are bad.

I think the resize use GD library, or?

If the reduction function in the new and old jDownloads is the GD library with the same settings (?), why the quality of the resized images (thumbnail) in the new jdownloads a so bad?
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Arno on 30.05.2015 00:17:16
QuoteIf the reduction function in the new and old jDownloads is the GD library with the same settings (?), why the quality of the resized images (thumbnail) in the new jdownloads a so bad?
It should be the same. But i will check this.
Yes, GD is used for it.
Title: Re: Thumbnails - bad png quality - gd library (J3.4.1 - JD 3.2.31)
Post by: Nyx on 30.05.2015 00:32:28
Hi,

I think i found the Problem  ;)

You use the "false" php function

in "/administrator/components/com_jdownloads/helpers/jdownloadshelper.php" LINE: 1002

        /* resize it */
        imagecopyresized($newpic,$oldpic,0,0,0,0,$newwidth,$newheight,$width,$height);


i change it to the php function "imagecopyresampled"

Quote
imagecopyresized() copies a rectangular portion of one image to another image. dst_image is the destination image, src_image is the source image identifier.

imagecopyresampled() copies a rectangular portion of one image to another image, smoothly interpolating pixel values so that, in particular, reducing the size of an image still retains a great deal of clarity.

http://php.net/manual/de/function.imagecopyresampled.php

so the new code is:


imagecopyresampled($newpic,$oldpic,0,0,0,0,$newwidth,$newheight,$width,$height);



It looks better with interpolating  ;D


org:
(http://i58.tinypic.com/1zxuuma.jpg)

JD - BAD:
(http://i58.tinypic.com/2cnfew6.jpg)


JD with new code / imagecopyresampled():
(http://i58.tinypic.com/2u4rm0y.png)


Or:

org:
(http://i59.tinypic.com/2rfzgac.jpg)

JD Bad:
(http://i61.tinypic.com/iwr7z6.jpg)

JD with new code / imagecopyresampled():
(http://i59.tinypic.com/wjct29.jpg)

Title: Re: Thumbnails - bad png quality - gd library - [Fixed in 3.2.33!!!]
Post by: Arno on 30.05.2015 00:59:42
Hi,
you have right. 'imagecopyresampled' seems to be the better choice.  ;)
So i have it changed in version 3.2.33 (coming very soon).
Thanks for your help.
Title: Re: Thumbnails - bad png quality - gd library - [Fixed in 3.2.33!!!]
Post by: Nyx on 30.05.2015 01:10:19
ok perfect, no problem - and also thanks to you  ;)