[TYPO3-core] RFC #13283: Thumbnail generation broken for PDF files

Andy Grunwald [wmdb] andreas.grunwald at wmdb.de
Mon Feb 22 09:44:33 CET 2010


Am 22.02.2010 08:28, schrieb Steffen Ritter:
>
> attached is the corrected version
+1 by reading but there is some space for improvements.

For example in the following line:
 > if (strtolower(substr($input,-3)) == 'pdf') {
Why you don`t use t3lib_div::split_fileref ?
With  this improvement it is easier to alter the code for another file 
conditions.
Proposal:
$fileResult = t3lib_div::split_fileref($input);
if (fileResult['fileext']  === 'pdf') {

Another point is the second condition with "noFramePrepended":
 > } else if (!$this->noFramePrepended && $frame >= 0) {
If i read the coding guidelines correctly, the usage of "else if" is 
forbidden.
Look at 
http://typo3.org/documentation/document-library/core-documentation/doc_core_cgl/4.3.2/view/1/3/ 
in the "Conditions" section:
 > Conditions consist from if, elseif and else keywords. TYPO3 code must 
not use the else if construct.

This is not a bad review. You do a great job! I only want to help to 
make TYPO3 a little bit better :)

Have a nice day,
Andy


More information about the TYPO3-team-core mailing list