Project

General

Profile

Bug #59528

Updated by Tymoteusz Motylewski about 9 years ago


 At the TYPO3\CMS\Core\Resource\Service\IndexerService::indexFile method the file size is determined by getimagesize: 

 <pre> 
 list($fileInfo['width'], $fileInfo['height']) = getimagesize($rawFileLocation); 
 </pre> 

 On failure, FALSE is returned. 
 @see http://mx2.php.net/manual/en/function.getimagesize.php 

 If ann error occours, fileInfo['width'] and $fileInfo['height'] will be NULL and the following MySQL error happens: 
 <pre> 
 Column 'height' cannot be null 

 INSERT INTO sys_file 
 (creation_date,modification_date,size,identifier,storage,name,sha1,type,mime_type,extension,height,width,crdate,tstamp) 
 VALUES 
 ('1402489970','1402489970','85429','/uploads/pics/image.jpg','0','image.jpg','8c9841ca0080cd2c96ca087c83f33ed3a4cd5204','2','image/jpeg','jpg',NULL,NULL,'1402574658','1402574658') 
 </pre> 


 This error occurs, for example when rendering an image in the FE and a crop-scale is executed. So the image has to be indexed. 

 It can be fixed with the following code(see the diff): 

 <pre> 
 if (is_array($imageSize = getimagesize($rawFileLocation))) { 
	 $fileInfo['width'] = $imageSize[0]; 
	 $fileInfo['height'] = $imageSize[1]; 
 } 
 </pre> 

 btw: sorry for my englisch.

Back