Project

General

Profile

Actions

Bug #59528

closed

Epic #65815: Improve Indexed search indexer

SQL-Error: Column 'height' cannot be null

Added by rengaw83 over 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2014-06-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

getimagesize.diff (928 Bytes) getimagesize.diff rengaw83, 2014-06-12 15:40
Actions

Also available in: Atom PDF