News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Thumbnails - bad png quality - gd library - [Fixed in 3.2.33!!!]

Started by Nyx, 20.05.2015 15:51:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nyx

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:



Bad:



OR:

Orginal:


resize with photoshop:


resize with JD / plupload:

  •  

Nyx

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?
  •  

Arno

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]
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Nyx

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]
  •  

Arno

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.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Nyx

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?
  •  

Arno

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.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Nyx

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:


JD - BAD:



JD with new code / imagecopyresampled():



Or:

org:


JD Bad:


JD with new code / imagecopyresampled():


  •  

Arno

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.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Nyx

  •