Hi... really this one make me crazy.

1) CCK 6.x-2.9
Drupal 6.22
FileField 6.x-3.10

3) www-data has rw to /tmp and sites/default/files and I can upload other type of file on simple filefield (like .txt).
4) public
5) see the image object down
6) click on upload button and see the thumbnail at the end of the upload
7) click... wait 0.5s and show two erro messages inside the widget:
* "The file is not a known image format"
* "The selected file %name could not be saved."

8) create a node, try to upload an image.

I'm on Debian squeez. Sudently I get "The file is not a known image format" every time I try to upload an image without apparently changing somethings...

I print_r the file object in the image inside the function filefield_validate_is_image. So in fact is "simply" than image_get_info return FALSE. After the upload they are no file in /tmp...

I check than I have fileinfo extension loaded and it is. It's installed with http://packages.debian.org/squeeze/libapache2-mod-php5

Is linked to the server configuration because on local it works with the files and database from the production.

Here the file object:

stdClass Object
(
    [filename] => screen_shot_2011-07-17_at_1.42.03_pm.png
    [filepath] => /tmp/php32093o
    [filemime] => image/png
    [source] => group_images_field_image_0
    [destination] => sites/default/files/articles-thumbnail-image/screen_shot_2011-07-17_at_1.42.03_pm.png
    [filesize] => -19
    [field] => Array
        (
            [field_name] => field_image
            [type_name] => articles
            [display_settings] => Array
                (
                    [weight] => 0
                    [parent] => group_images
                    [label] => Array
                        (
                            [format] => hidden
                        )

                    [teaser] => Array
                        (
                            [format] => image_plain
                            [exclude] => 0
                        )

                    [full] => Array
                        (
                            [format] => image_plain
                            [exclude] => 1
                        )

                    [monsite_one_col] => Array
                        (
                            [format] => thumbnail_one_col_linked
                            [exclude] => 0
                        )

                    [monsite_one_col_promoted] => Array
                        (
                            [format] => thumbnail_one_col_promoted_linked
                            [exclude] => 0
                        )

                    [monsite_two_col] => Array
                        (
                            [format] => thumbnail_two_col_linked
                            [exclude] => 0
                        )

                    [4] => Array
                        (
                            [format] => image_plain
                            [exclude] => 0
                        )

                    [2] => Array
                        (
                            [format] => image_plain
                            [exclude] => 0
                        )

                    [3] => Array
                        (
                            [format] => image_plain
                            [exclude] => 0
                        )

                    [token] => Array
                        (
                            [format] => image_plain
                            [exclude] => 0
                        )

                )

            [widget_active] => 1
            [type] => filefield
            [required] => 0
            [multiple] => 0
            [db_storage] => 0
            [module] => filefield
            [active] => 1
            [locked] => 0
            [columns] => Array
                (
                    [fid] => Array
                        (
                            [type] => int
                            [not null] => 
                            [views] => 1
                        )

                    [list] => Array
                        (
                            [type] => int
                            [size] => tiny
                            [not null] => 
                            [views] => 1
                        )

                    [data] => Array
                        (
                            [type] => text
                            [serialize] => 1
                            [views] => 1
                        )

                )

            [list_field] => 0
            [list_default] => 1
            [description_field] => 0
            [widget] => Array
                (
                    [file_extensions] => png gif jpg jpeg
                    [file_path] => articles-thumbnail-image
                    [progress_indicator] => bar
                    [max_filesize_per_file] => 
                    [max_filesize_per_node] => 
                    [max_resolution] => 0
                    [min_resolution] => 0
                    [alt] => 
                    [custom_alt] => 0
                    [title] => 
                    [custom_title] => 0
                    [title_type] => textfield
                    [default_image] => 
                    [use_default_image] => 0
                    [insert] => 0
                    [insert_styles] => Array
                        (
                            [auto] => 0
                            [link] => 0
                            [image] => 0
                            [imagecache_thumbnail_actualite] => 0
                            [imagecache_reg] => 0
                            [imagecache_gallery_assist-gallery_assist-thumbnail-100] => 0
                            [imagecache_gallery_assist-gallery_assist-preview-550] => 0
                            [imagecache_group_images] => 0
                            [imagecache_thumb] => 0
                            [imagecache_member_list_image] => 0
                            [imagecache_user_picture_meta] => 0
                            [imagecache_profile_pictures] => 0
                            [imagecache_thumbnail_two_col] => 0
                            [imagecache_thumbnail_author] => 0
                            [imagecache_short] => 0
                            [imagecache_thumbnail_one_col] => 0
                            [imagecache_tiny] => 0
                            [imagecache_gallery_assist-default-thumbnail-100] => 0
                            [imagecache_group_images_thumb] => 0
                            [imagecache_40x40] => 0
                            [imagecache_gallery_assist-default-preview-550] => 0
                            [imagecache_thumbnail_one_col_promoted] => 0
                            [imagecache_thumbnail_teaser] => 0
                        )

                    [insert_default] => auto
                    [insert_class] => 
                    [insert_width] => 
                    [label] => Thumbnail Image
                    [weight] => 0
                    [description] => 
                    [type] => imagefield_widget
                    [module] => imagefield
                )

        )

)

Comments

gagarine’s picture

They is a closed issue but is *not* the same cause (I'm not on IIS thanks God) #419734: supported file types return - The file is not a known image format

gagarine’s picture

Title: "The file is not a known image format" on allowed format » drupal settings path to tmp folder has to match the php.ini one

Oki I found the problem... my phpinfo give me a tmp in "/var/tmp" (the default tmp in my system) but my drupal setting was set to "/tmp". I keep it active because other file transfer was working. If it's by design we need to display an better error message.

AaronBauman’s picture

are you talking about upload_tmp_dir in php.ini?
I'm having the same symptoms, and this value is simply not set in my php.ini.
In Drupal, it's config'ed to /tmp, which is a+rwx

this is a critical issue for me, but only on a handful of sites.
I just don't get why this started happening all of a sudden.

quicksketch’s picture

Category: bug » support

I don't think this is a bug that ImageField/FileField can really address. If a file can't be read (probably because of permissions), then ImageField will likely have problems like this.