I performed a standard installation of ImagePicker 6.x-2.3 from 6.x-2.2 (disable module, remove imagepicker module from /sites/all/modules, adding new version, enabling, running update.php), and the database upgrade completed without errors. However, upon trying to administer ImagePicker settings (admin/settings/imagepicker), I encountered the following error:

PHP Warning: Call-time pass-by-reference has been deprecated in D:\Drupal6\sites\all\modules\imagepicker\imagepicker.admin.inc on line 476

While I can access the ImagePicker items in my account, I am unable to edit the admin settings of the ImagePicker. I reviewed my permissions, and reapplied them just to make sure that wasn't the issue. Searching via Google about that error reviewed that an "&" reference in other modules has caused this problem (http://drupal.org/node/164387), so I visited line 476 on imagepicker.admin.inc and removed the "&" from this line below:

Line: 476 imagepicker_user_config_admin_form_validate($form, &$form_state);

Doing so allowed me to administer my imagepicker settings, but I somehow doubt this hack is the approved method of doing so. After arriving at my ImagePicker admin settings, I now encountered a new error/warning at the top of settings page (admin/settings/imagepicker)

Function exif_imagetypetion does not exist. Advanced image manipulation cannot be done. Please make sure that you are running PHP 4.3 or higher, or that you (or your hosting provider) manually compile the GD library into your PHP installation. You also need PHP to be compiled with --enable-exif.

This site has only ever run in PHP 5.x (currently 5.2.10 and PHP Mem Limit of 128MB).

Any suggestions on these issue? Sorry if the description of this problem was lengthy, I'm a bit new at filing any of these types of errors, and typically find others have already found and solved problems like this when I encounter them. I searched for a duplicate issue, but could not find one. Sorry if I overlooked it.

Comments

GatorBat’s picture

It appears that the exif issue may be the result of needing to load a PHP extension for EXIF support: http://drupal.org/node/77406

Anyone else able to confirm this?

hutch’s picture

First of all, lengthy descriptions of a bug are an awful lot better than "It dont work" ;-)

Yes this is a bug I'm pretty sure, the '&' should be in the parameters of imagepicker_settings_form_validate() and not where it is.
I am not getting an error though but my version of php looks to be older, PHP 5.2.0.
I have commited the fix to the 2.x dev version.

The second message comes from imagepicker_image_check_functions() which checks if the functions required for the new watermark feature to work are present. These days that is (at least on Debian) just a package that needs to be installed. I don't know how that works on Windows but I imagine it's much the same. The library is GD or GD2

Good to know that imagepicker_image_check_functions() works as expected, I was not able to test it without hacking my php install. Not that I had any reason to believe it might not work, it is adapted from the watermarks module which has been around a while.

Thanks!

GatorBat’s picture

Just wanted to confirm that the PHP Deprecation Warning in the original post has indeed been resolved in the 6.x-2.4 release. Many thanks Hutch for the quick response and patch. I'm pretty certain the EXIF issue will be resolved when I reload PHP with the additional parameters needed, so I would go ahead and mark this issue resolved :)

hutch’s picture

Version: 6.x-2.3 » 6.x-2.4
Status: Active » Fixed

This issue and some others fixed in 6.x-2.4 and latest 2.x-dev

held69’s picture

Status: Fixed » Active

Just Upgraded from 6.x-2.x-dev (2009-jul-22) to 6.4 but getting the same error.

After 6.4 i've upgrade to 6.x-2.x-dev 2009-Sep-15.

However the same error remains...

hutch’s picture

Can you supply the exact error you are seeing?
Also which version of php

held69’s picture

Thanks for your swift reply.

In the screen of node/add/contenttype and user/1/imagepicker i see:

Function exif_imagetypetion does not exist. Advanced image manipulation cannot be done. Please make sure that you are running PHP 4.3 or higher, or that you (or your hosting provider) manually compile the GD library into your PHP installation. You also need PHP to be compiled with --enable-exif.

Php:5.2.9

hutch’s picture

my php uses extensions, I install the debian package php5-gd and ensure that it is enabled with extension=gd in php.ini
How you do that on your box depends on the OS/distro

held69’s picture

mmm thanks

i'm kind of unexperienced in this area.
I got my site hosted at a company (OS is linux ), so i never installed php myself.

I guess i should contact my host company..

hutch’s picture

Get the hosting company to install imagick as well, not that you have an immediate use for it but there might be in the future
Or perhaps there is a cpanel where it's an option you have to set

-Anti-’s picture

I have just installed this module for the first time and got the error in #7.
My hosting is a VPS account, with a completely average, normal install of WHM/cpanel.

I have no idea how to 'manually compile the GD library into your PHP'.
The VPS came with a default install of GD2 that works with all the other image modules I've tried.

I also have no idea how to 'compile PHP with --enable-exif'
Again, it is a completely, vanilla, normal PHP installation, that anyone ordering a VPS will receive.

You should probably make it clearer on the project page that this module has special hosting
requirements, to help prevent hundreds of people downloading it only to find they can't use it.

It's a shame that it uses a non-standard php set-up, because it looked like a good module!

hutch’s picture

imagepicker does not require any special setup, if you don't have exif enabled then you won't be able to use watermarks.

I don't know anything about "WHM/cpanel" so I can't comment on how that works.

Try the dev version, it is less noisy about this and has a couple of other minor fixes.

held69’s picture

Hutch i'm a little confused here.
The error mentioned under #7 also pops up using the dev. version.
Your suggested solution (gd install)does look a bit like a special setup.

Is there a way then to ignore the gd install and still use the imagepicker without these errors mentioned under #7?

Thanks

By the way
I contacted my host....
he wants to test first before installing.

hutch’s picture

First of all it's not an error, it is a warning telling you that you have not got exif enabled on your php install. You can use imagepicker but not all its features.

You can check for yourself, create a file info.php with the following in it:

<?php
phpinfo();
?>

upload info.php to your html folder and point your browser at it.

held69’s picture

I understand.
However, especially from a users point i think, it can be quite confusing.
Seeing such a warning, while there is nothing wrong with the basic functions of the module, can create the feeling something is not working properly.

At least i got thrown off there.

Maybe change this warning into advice or extra feature to user nr 1 only?

-Anti-’s picture

> imagepicker does not require any special setup, if you don't have exif enabled then you won't be able to use watermarks

Ah, thanks for clarifying!
And so when Drupal 'Error reporting' is switched to 'log only', no-one will see the imagePicker warning.

> Your suggested solution (gd install) does look a bit like a special setup

GD library is a common php extension; almost standard.
I think any drupal image module would require this (or imagemagick).
It is the exif extension that is less widely employed and slightly unusual.

I found out how to add exif and GD2 on whm/cpanel. It's fairly straightforward:
WHM -> easyapache -> wizard (you need to understand what you're doing though) -> 'exhustive php' options
I don't know what the dangers are when apache is re-compiled though; is there a risk destroying your WHM install?

Anyway, thanks for sharing the module and the clarification of its requirements.
I'll give it another go tonight.

Cheers.

held69’s picture

that clears things up a lot.

Thanks :)

hutch’s picture

I have commited a simplified warning message, don't want to scare anyone ;-)
I suppose only diehards still compile in situ, these days its just a matter of enabling a module.

-Anti-’s picture

Hmmm... ignoring the warning, I gave the module a little test.
I'm using wysiwyg API + NicEdit, and the 'insert image' button doesn't work.
Well, it does if I disable the editor, but not while nicEdit is active.

I got the same thing when I tested 'imagefield insert'.

Is this the editor's fault?
If so, do you know which editors will allow images to be inserted?

Thanks

hutch’s picture

wysiwyg API + FckEditor works for me.

hutch’s picture

Status: Active » Closed (fixed)