Bug #59528
closedEpic #65815: Improve Indexed search indexer
SQL-Error: Column 'height' cannot be null
100%
Description
At the TYPO3\CMS\Core\Resource\Service\IndexerService::indexFile method the file size is determined by getimagesize:
list($fileInfo['width'], $fileInfo['height']) = getimagesize($rawFileLocation);
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:
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')
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):
if (is_array($imageSize = getimagesize($rawFileLocation))) { $fileInfo['width'] = $imageSize[0]; $fileInfo['height'] = $imageSize[1]; }
btw: sorry for my englisch.
Files
Updated by Florian Schaeffer about 10 years ago
Confimed on 6.1.9 and 6.1.10
Your solution solved my problem, I could successfully perform an index job after applying your diff.
Updated by Tymoteusz Motylewski over 9 years ago
- Description updated (diff)
- Parent task set to #65815
Updated by Stefan Neufeind over 9 years ago
- TYPO3 Version changed from 6.1 to 6.2
Only applies to 6.2 now. In master (7) this is taken care of in the ImageInfo-class.
Updated by Gerrit Code Review over 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42649
Updated by Stefan Neufeind over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7ac473752e009a888ec22ca6e50107e18a811d34.