PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

File is not an image when using wp_get_image_editor

  1. Hello,

    I'm saving an image via File Upload field and it's path is stored in user metadata. So far so good.
    I now need to grab that image and resize it. I'm trying to do it with wp_get_image_editor() as following: $image = wp_get_image_editor( $file ); where $file is the correct path to the image.

    However, this returns the following error:

    [0] => WP_Error Object
                            (
                                [errors] => Array
                                    (
                                        [invalid_image] => Array
                                            (
                                                [0] => File is not an image.
                                            )
    
                                    )
    
                                [error_data] => Array
                                    (
                                        [invalid_image] => http://example.com/wp-content/uploads/gravity_forms/13-37ec33fbff5089a494d9ad0574a67403/2013/05/la-fitness.jpg
                                    )
    
                            )

    Any idea what might be wrong? Maybe I need to pass mime type to wp_get_image_editor()? I don't know how to do it.

    I would hugely appreciate any help.

    Many thanks,
    Dasha

    Posted 6 years ago on Tuesday May 7, 2013 | Permalink
  2. Handling via priority support.

    Posted 6 years ago on Wednesday May 22, 2013 | Permalink

This topic has been resolved and has been closed to new replies.