Thumbnails are looking overexposed

Baraja

Joined: 2007-03-26
Posts: 34
Posted: Sat, 2014-03-01 19:46

Hi,

when i upload a photo the thumbnail that gets created looks overexposed. I've tried already to recreate the thumbs (resize in theme option) and also marked them as dirty but as of now nothing has helped.

Attached you can find a example of what i mean.

On the server, the GD Library is installed.

I'd appreciate any help.

Regards

AttachmentSize
org.jpg53.12 KB
thumb.jpg21.92 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2014-03-01 20:12

This user changed toolkits to get better results:
http://galleryproject.org/node/112669#comment-408422

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Sun, 2014-03-02 07:00

Hi,

thanks for your answer. I'll try to get ImageMagick installed.

Anyways, i found this link that says that PHP 5.5.9, which im using, is the problem. Is there a chance to check if this is the issue?

Can i somehow try to downgrade to PHP 5.5.8 via htaccess?

Regards
Rico

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Sun, 2014-03-02 07:27

Hi,

another information: I've done the rebuild of the thumbnails on my unfortunately older, local backup (xampp with php 5.3.1 and GD Library) and there is works fine.

It really looks like the php version is the problem here.

Regards
Rico

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2014-03-02 17:32
Quote:
Can i somehow try to downgrade to PHP 5.5.8 via htaccess?

I don't know perhaps other community members can chime in.
from the link you supplied it said: 'or you can try turning off all image sharpening in Settings > Image publishing and that may help as well.'.
So you could try; admin -> settings -> advanced and adjust image_sharpen. Just a guess though.

Yes it does look like a php issue.
Perhaps waiting for the next release is the best bet.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Sun, 2014-03-02 18:55

I've tried "0" as well as empty for the setting but it didn't help.

Also, my hoster send me a path to ImageMagick but as of now i have no idea where i could put this...

Can you help me with this as well?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2014-03-02 19:30

Gallery will look in the 'path' and most common places where IM is installed. Your host should be able to set the path for the location they installed it for you.
See if Gallery finds it for you on the Admin -> Settings -> Graphics page.
There is also an advanced setting that might help as well:
Admin -> settings -> Advanced; 'graphics_toolkit_path'

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Mon, 2014-03-03 13:59

Hi Dave,

thanks so far for the support. I now got the path to the ImageMagick installation from my hoster and i've put it in the "graphics_toolkit_path" variable but it does not seem to work.
Once i go to Settings -> Graphics page, ImageMagick it is still greyed out.

I've tested whether the path is correct by executing this little sricpt:
<?php
exec("/path/to/ImageMagick/convert input.jpg -thumbnail 50x50 output.jpg");
?>

This has worked and the output.jpg got created.

Do i have to change the graphics_toolkit settings as well or am i missing something?

Thanks.

Rico

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2014-03-03 14:40

I don't know. Mine just works out of the box as my host(s) have IM and GM in the path. There is another advanced setting for changing the toolkit.
graphics_toolkit imagemagick is what I have.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Mon, 2014-03-03 15:57

Thanks dave, i'm getting closer. Now ImageMagick is the select tool but it is still considered as not installed.

Do you have more ideas how i could fix this? I've searched the web an saw a lot of "...turn safe_mode = Off" and "... change open_basedir to..."

In my php-settings, safe_mode is already off. The only thing is that in the "open_basedir", the path to the ImageMagick installation is not contained. Can this be a problem?

By the way, if you need any information like phpinfo please let me know.

Thanks

Rico

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2014-03-04 00:57
Quote:
Do you have more ideas how i could fix this?

Sorry not from me. Perhaps some server expert can chime in or as your host to change the path to /usr/bin as I think that is a standard location.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Tue, 2014-03-04 05:53

Thanks for the answer. My host told me that each php script is allowed to execute ImageMagick within the given path but reading the binaries is not allowed.

Is gallery3 trying to read the binaries?

Rico

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2014-03-04 13:54

This bit of code:

	/**
	 * Attempts to detect the ImageMagick installation directory.
	 *
	 * @throws  Kohana_Exception
	 * @param   array   configuration
	 * @return  void
	 */
	public function __construct($config)
	{
		if (empty($config['directory']))
		{
			// Attempt to locate IM by using "which" (only works for *nix!)
			if ( ! is_file($path = exec('which convert')))
				throw new Kohana_Exception('The ImageMagick directory specified does not contain a required program.');

			$config['directory'] = dirname($path);
		}

		// Set the command extension
		$this->ext = (PHP_SHLIB_SUFFIX === 'dll') ? '.exe' : '';

		// Check to make sure the provided path is correct
		if ( ! is_file(realpath($config['directory']).'/convert'.$this->ext))
			throw new Kohana_Exception('The ImageMagick directory specified does not contain a required program, :im:', array(':im:' => 'convert'.$this->ext));

		// Set the installation directory
		$this->dir = str_replace('\\', '/', realpath($config['directory'])).'/';
	}

is what kohana tries to detect the IM code.
if that is 'reading' I don't know.

Quote:
I've tested whether the path is correct by executing this little sricpt:
<?php
exec("/path/to/ImageMagick/convert input.jpg -thumbnail 50x50 output.jpg");
?>

see if you can get 'which convert' to see what the results are. Perhaps your host has that disallowed.

Getting deeper for this is beyond my skill set so I will let others help you out.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Baraja

Joined: 2007-03-26
Posts: 34
Posted: Tue, 2014-03-04 16:22

Thanks for your support.

After i was browsing the forum and the FAQs i finally found the problem:
In modules/gallery/helpers/graphics.php there is a function "detect_toolkits". Within this function there is this part of code:

Quote:
foreach ($magick_kits as $index => $settings) {
$path = system::find_binary(
$settings["binary"], module::get_var("gallery", "graphics_toolkit_path"));
$toolkits->$index->name = $settings["name"];
if ($path) {
if (@is_file($path) &&
preg_match(
$settings["version_regex"], shell_exec($path . " " . $settings["version_arg"]), $matches)) {

The general problem i'm facing is that the ImageMagick path is not part of the open_basedir variable. I found that because the $path variable was empty so i looked into the find_binary function. There the function "file_exists" is used which fails due to the open_basedir problem. By the way, the is_file condition won't be met either due to the problem.

I was able to modify graphics.php so that ImageMagick was recognized as installed but uploading files and creating thumbnails hasn't worked (thumbnail as well as small picture are looking like a broken image but the real image got uploaded and can be displayed properly):

Quote:
foreach ($magick_kits as $index => $settings){
$path = module::get_var("gallery", "graphics_toolkit_path").$settings["binary"];
$toolkits->$index->name = $settings["name"];
if ($path) {
if (preg_match(
$settings["version_regex"], shell_exec($path . " " . $settings["version_arg"]), $matches)) {

As of now i have now idea how to proceed.

I'd appreciate any help (again, thanks Dave)

Rico