tags:

views:

62

answers:

3

I've inherited a site built with Drupal, moved it to a different server (from Ubuntu Server 9.10 to Ubuntu Server 10.04) and now I'm geting the following error when I trying to upload an image via an ImageField.

„160284.jpg” nem tölthető fel. The file is not a known image format.

The first (localized) part of the error is „160284.jpg” cannot be uploaded."

I've noticed that the second part of the error is not true. It is generated in filefield_validate_is_image() and is caused by the file referenced in $file->filepath missing.

File permissions shouldn't be a problem because right now everything is just 777. The temp directory is writable too.

What is causing the error?

+1  A: 

The problem could be rooted in PHP needing some image library or you didn't activate needed image API modules to handle it.

googletorp
A: 

You probably don't have libjpeg.so installed, or don't have PHP compiled with support for GD. Confusingly, the errors that Drupal passes along don't give any hint that this is probably a PHP issue unrelated to Drupal.

If you have Devel installed, go to devel/phpinfo and check the "JPG Support" line under the "gd" heading.

If GD is supported but there's no JPG support, recompile PHP with --with-jpeg-dir=/usr/lib or check the manual for your OS and PHP version. If you're on a shared host, you may need to open a ticket for tech support, asking them to add GD JPEG support for PHP.

Similarly, if there's no "gd" heading under devel/phpinfo, you'll need to recompile PHP with '--with-gd', or open a ticket with tech support on a shared host, etc.

The folks over at www.serverfault.com can help you if you have any trouble getting GD support to work right, but it's usually straightforward.

anschauung
I'm using the stock Ubuntu Server PHP package (5.2.6-3ubuntu4.5) and I have the appropriate modules installed. Both GD and JPG support seems to be OK.
ashraf
A: 

PHP has GD support with jpg enabeled. Any other suggestions for the error message?

H Maier