This notice shows when the module tries to update an image that has no original image dimensions saved:

Notice: Undefined property: stdClass::$image_dimensions in file_entity_file_update() (Line 90 of ***/www/sites/all/modules/file_entity/file_entity.file.inc).

Line 90 of file_entity.file.inc:

90    if ( $file->image_dimensions != $file->original->image_dimensions ) {
91      _file_entity_update_image_field_dimensions($file);
92    }

This fixes the notice:

if (
   isset($file->image_dimensions) && 
   isset($file->original->image_dimensions) && 
   $file->image_dimensions != $file->original->image_dimensions
){
  _file_entity_update_image_field_dimensions($file);
}

Comments

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

I believe this has been fixed since the image dimensions table is no more and was converted to metadata. Does this still need to be fixed with the metadata API?

artfulrobot’s picture

Issue summary: View changes

I'm seeing a similar error when uploading an image file to a file field using entity_metadata_wrapper on a node that previously had an empty file field.

Notice: Undefined property: stdClass::$image_dimensions in file_entity_file_update() (line 63 of ...sites/all/modules/file_entity/file_entity.file.inc).

The following patch fixes it:

diff --git a/sites/all/modules/file_entity/file_entity.file.inc b/sites/all/modules/file_entity/file_entity.file.inc
index 3b76626..cdcc379 100644
--- a/sites/all/modules/file_entity/file_entity.file.inc
+++ b/sites/all/modules/file_entity/file_entity.file.inc
@@ -60,7 +60,8 @@ function file_entity_file_update($file) {
   if ($file->type == 'image' && module_exists('image')) {
     // If the image dimensions have changed, update any image field references
     // to this file and flush image style derivatives.
-    if ($file->image_dimensions != $file->original->image_dimensions) {
+    if (!isset($file->original->image_dimentions) ||
+     ($file->image_dimensions != $file->original->image_dimensions)) {
       _file_entity_update_image_field_dimensions($file);
     }
 
Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)