File is not valid on element field_media_image[0][image_crop]

Created on 20 October 2021, over 2 years ago
Updated 17 August 2023, 11 months ago

Problem/Motivation

As a content editor, when I try to upload a image with crop feature configured using 'image_widget_crop' module,
I get an error saying The file "filepath://file_name.jpeg" is not valid on element field_media_image[0][image_crop].

I have validated the the image size and image type both are allowed, and other images with higher file size and same file name and type are working fine without any issues.

What could be the issue here 🤔
I was suspecting $image->isValid() in the processCrop function is looking for any specific metadata in image?

🐛 Bug report
Status

Active

Version

2.3

Component

Crop

Created by

🇮🇳India neerajsingh IN 🇮🇳

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Philipp jor

    I Have the same problem, after update to drupal 8.9.1:

    Test 1:
    drupal/image_widget_crop 2.3.0
    drupal/crop 2.1.0
    drupal 8.9.1

    test 2:
    drupal/crop 2.2.0
    drupal/core 8.9.1
    drupal/image_widget_crop 2.4.0
    drupal 8.9.1

    I updated drupal and put the code on a new server with same same php7.2 version
    This worked before (same like test1):
    drupal/crop 2.1.0
    drupal/image_widget_crop 2.3.0
    drupal/core: 8.8.7

    I got the same error.
    Any ideas what i has to check?

  • 🇮🇳India sasikala_d

    I'm also facing the same issue did u got any solution for this issue

  • 🇳🇱Netherlands roaldnel

    We also encountered the same issue after upgrading our project to Drupal 10. We would appreciate it if someone could look into this, thanks in advance!

  • 🇦🇹Austria DrColossos

    We had the same problem in our dev environment. The issue was, that the original image was not available. After stage_file_proxy downloaded it properly, the cropping did work as expected.

Production build 0.69.0 2024