Announcement

#16 2012-11-08 17:20:42

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

I understand : The uploadify js is used. The error is handle by it
case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:e=uploadifyLang["errorString2"]+" ("+d+")";break;
so it returns the error code which is here 500
We will get rid of it and use html5 soon or later


About GD here is how Piwigo determine the graphic library

Code:

  static function is_imagick()
  {
    return (extension_loaded('imagick') and class_exists('Imagick'));
  }

  static function is_ext_imagick()
  {
    global $conf;

    if (!function_exists('exec'))
    {
      return false;
    }
    @exec($conf['ext_imagick_dir'].'convert -version', $returnarray);
    if (is_array($returnarray) and !empty($returnarray[0]) and preg_match('/ImageMagick/i', $returnarray[0]))
    {
      if (preg_match('/Version: ImageMagick (\d+\.\d+\.\d+-?\d*)/', $returnarray[0], $match))
      {
        self::$ext_imagick_version = $match[1];
      }
      return true;
    }
    return false;
  }

so you have traces of IM somehow : try these functions on a separate php file to see what matched

Waiting for your plugin report Sir! ^^


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#17 2012-11-08 17:27:10

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Removing the plugin fixed my original installation. All other plugins are ok.

It would seem that the 'User Tags' plug in is directly responsible the problems with the flash uploader.

When enabled, it prevents the flash uploader from working, and it displays an HTTP Error (500).

when I click "Display reference file: "config_default.inc.php" " without the User Tags plugin installed, the reference file opens fine. When I try it with the plugin installed, I get the non recoverable error previously mentioned, including the path with a double forward slash.

This looks like its happening on line 61 of t4u_config.class.php

Code:

private function get_config_file_dir() {
   return $GLOBALS['conf']['data_location'].'/plugins/';
}

If I change this line to remove the trailing forward slash from the path, then deactivate and reactivate the plugin the non recoverable error still occurs, but I'm wondering if that's a cacheing issue, or I just found the wrong spot?

---

The ImageMagic error being recorded in my Apache log is due to the default installation not being 100% configured for GD. The new install (without forcing settings to GD) lists GD as the graphics library under 'environment' on the Admin page, but still tried to use Image Magic.

I suspect this relates to the code on line 251 on http://piwigo.org/dev/browser/trunk/adm … c.php#L151 where the code reads:

Code:

if (pwg_image::get_library() != 'gd')

Even though the default should be set to GD, I suspect this variable is not being set as standar, and so it tries to run Image Magic code, causing an error in my log file to appear.

Offline

 

#18 2012-11-08 17:31:51

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

There we go, it's nice being able to view the config file :)

As standard,

Code:

$conf['graphics_library'] = 'auto';

So the standard graphic library will cause

Code:

if (pwg_image::get_library() != 'gd')

to trigger, even if GD is being used.

If the IM check fails, it might be worth changing the variable from auto to gd

Last edited by Kaz (2012-11-08 17:33:03)

Offline

 

#19 2012-11-08 17:34:35

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Kaz wrote:

There we go, it's nice being able to view the config file :)

As standard,

Code:

$conf['graphics_library'] = 'auto';

So the standard graphic library will cause

Code:

if (pwg_image::get_library() != 'gd')

to trigger, even if GD is being used.

no

Code:

  static function get_library($library=null, $extension=null)
  {
    global $conf;

    if (is_null($library))
    {
      $library = $conf['graphics_library'];
    }

    // Choose image library
    switch (strtolower($library))
    {
      case 'auto':
      case 'imagick':
        if ($extension != 'gif' and self::is_imagick())
        {
          return 'imagick';
        }
      case 'ext_imagick':
        if ($extension != 'gif' and self::is_ext_imagick())
        {
          return 'ext_imagick';
        }
      case 'gd':
        if (self::is_gd())
        {
          return 'gd';
        }
      default:
        if ($library != 'auto')
        {
          // Requested library not available. Try another library
          return self::get_library('auto', $extension);
        }
    }
    return false;
  }

that checks all the libraries available. See, no break;


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#20 2012-11-08 17:36:18

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

What's your environment? On the first admin page


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#21 2012-11-08 18:11:45

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Flop, I've already answered that question a couple of times, but I'll do so again :).

But before we get there.

Once I disable 'User Tags' everything works as per the original setup.

The HTTP Error 500 is 100% caused by the 'User Tags' plugin.

The issue with the error generated when I try to view the default config when clicking the link from inside Local Files editor is also 100% caused by the 'User Tags' plugin.

Once I take 'User Tags' out of the equation, I am still left with an error in my Apache log file caused by piwigo trying to access image magic's 'convert' function.

On my second install, I have not added the config line forcing the server to use the GD library.

On the Admin Home page, the Graphics Library is displaying as GD 2.0

If I view the default config linked from local files editor, the variable is set to 'auto'.

I'm just trying to help, you can say no, its not how it is, but that 'is' the case.

Last edited by Kaz (2012-11-08 18:13:50)

Offline

 

#22 2012-11-08 18:20:29

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Kaz wrote:

Flop, I've already answered that question a couple of times, but I'll do so again :).

? you were not connected with that account maybe, but in this thread -which seems to be your first one- no mention on OS, version of php... or even screen shots!
Don"t want to bother you but that's the truth

Kaz wrote:

Once I disable 'User Tags' everything works as per the original setup.

The HTTP Error 500 is 100% caused by the 'User Tags' plugin.

The issue with the error generated when I try to view the default config when clicking the link from inside Local Files editor is also 100% caused by the 'User Tags' plugin.

Once I take 'User Tags' out of the equation,

okay good news! I will notify the author (plugin not updated for 16 months)

Kaz wrote:

I'm just trying to help, you can say no, its not how it is, but that 'is' the case.

Could you try the functions [Forum, post 136932 by flop25 in topic 20692] Backend attempting to using ImageMagic and generating http 500 error ? Do you have any php knowledges to do that?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#23 2012-11-08 18:23:15

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Yes I do have the phgp knowledge, that code you linked isn't really doing all that much based on it's usage on the line I pointed out.

Code:

if (pwg_image::get_library() != 'gd')

That's not passing any variables into the get_library function

Code:

static function get_library($library=null, $extension=null)

That's passing $library=NULL due to the lack of library being passed in when used

Code:

if (is_null($library))
    {
      $library = $conf['graphics_library'];
    }

Thats setting $library to whatever the default is (according to localfiles editor) thats 'auto'

Code:

return false;

The switch isn't doing anything, and then the function is returning false to all input.

Code:

if (pwg_image::get_library() != 'gd')

If all responses are false, then it will ALWAYS match on !='gd'

Offline

 

#24 2012-11-08 18:27:39

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

copy past for Personal plugin in Localfiles editor

Code:

add_event_handler('init', 'MY');
function MY()
{

if (function_exists('gd_info'))
{
echo("GD GD GD GD GD GD ");
}
else
{
echo("NO WAY");
}
}

edit : and enable the personal plugin . Even mr I usually forgot^^

Last edited by flop25 (2012-11-08 18:30:43)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#25 2012-11-08 18:44:28

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Flop

That function you wrote contains a parse error. However, once corrected I am unable to save the file

"Current file isn't writeable. Check if a directory "local/" is writeable (chmod)."

local IS writable (chmod 777), as are the current directories in local (config, css and language)

BTW, in the very first post I wrote "According to the Admin Home page the environment is using the GD 2.0 graphic library.". You've not asked about OS/PHP versions, if you need to know it, it can be seen in the screenshot previously uploaded (not sure what happened to the screenshots i uploaded yesturday) atatched them here (although they are no longer relevent)

OS: Linux
PHP: 5.3.2

Offline

 

#26 2012-11-08 18:57:07

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

They were no screeshot and just info about Gd, so I asked you "What's your environment? On the first admin page". Seems legit
Then you successfully uploaded screenshots where I saw what I need. No problem

Ubuntu is such a nightmare : in fact it seems they embed old packages of GD read [Forum, post 136846 by ppat in topic 20683] How to regenerate thumbnails ?
That might be the current problem here
Trying to solve an issue another one appears... well  create /plugin/PersonalPlugin/main.inc.php with the content I wrote

when I said exotic server config... ^^


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#27 2012-11-08 19:37:17

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

That error message needs changing as the local directory is irrelevent

"Current file isn't writeable. Check if a directory "local/" is writeable (chmod)."

I created "local/plugin/PersonalPlugin/main.inc.php" assuming that was what was needed.

I subsequently created /plugins/PersonalPlugin/main.inc.php and activated it.

As would expect, it said "GD GD GD GD GD GD ".

Not really sure what that proves.

I also don't see how ubuntu embedding an old version of GD would cause the script to attempt to exec an imagick convert

This plugin echos 'auto'

Code:

add_event_handler('init', 'MY');
function MY()
{
  global $conf;
  echo($conf['graphics_library']);
}

Last edited by Kaz (2012-11-08 19:37:50)

Offline

 

#28 2012-11-08 19:42:10

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

Kaz wrote:

That error message needs changing as the local directory is irrelevent

"Current file isn't writeable. Check if a directory "local/" is writeable (chmod)."

^^ yes that's a mistake

Let's try now

Code:

add_event_handler('init', 'MY');
function MY()
{
include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php');
  echo(pwg_image::get_library());
}

To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#29 2012-11-08 19:47:48

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

I also added

echo "I should not have ran";

to the is_ext_imagick() function in image.class.php and it displays on every page load of admin.php?page=photos_add (whether an image has just been uploaded or not)

Offline

 

#30 2012-11-08 19:51:05

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

that new handler now outputs "i should not have ran" on every page, twice on pages where it ran previously

it also echos "gd"

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact