Bug #59528

Epic #65815: Improve Indexed search indexer

SQL-Error: Column 'height' cannot be null

Added by rengaw83 about 7 years ago. Updated almost 3 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
#1

Updated by Florian Schaeffer almost 7 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.

#2

Updated by Tymoteusz Motylewski over 6 years ago

  • Description updated (diff)
  • Parent task set to #65815
#3

Updated by Stefan Neufeind almost 6 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.

#4

Updated by Gerrit Code Review almost 6 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

#5

Updated by Stefan Neufeind almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#6

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF