[TASK] Filelist: Info dialog shows image dimensions 52/51052/6
authorMichael Oehlhof <typo3@oehlhof.de>
Wed, 28 Dec 2016 08:03:36 +0000 (09:03 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 11 Jan 2017 21:07:13 +0000 (22:07 +0100)
The file info modal now contains the width and height of images

Resolves: #65822
Releases: master, 7.6
Change-Id: Iadb64ae3db4558bf74f15aaeac1fe29848120563
Reviewed-on: https://review.typo3.org/51052
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/lang/Resources/Private/Language/locallang_general.xlf

index 4aaf295..f91960b 100644 (file)
@@ -22,6 +22,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Resource\AbstractFile;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -327,6 +328,10 @@ class ElementInformationController
             if ($this->type === 'file') {
                 $extraFields['creation_date'] = htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.creationDate'));
                 $extraFields['modification_date'] = htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.timestamp'));
+                if ($this->fileObject->getType() === AbstractFile::FILETYPE_IMAGE) {
+                    $extraFields['width'] = htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.width'));
+                    $extraFields['height'] = htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.height'));
+                }
             }
             $extraFields['storage'] = htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file.storage'));
             $extraFields['folder'] = htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:folder'));
@@ -354,8 +359,12 @@ class ElementInformationController
                     $rowValue = $resourceObject->getStorage()->getName();
                 } elseif ($name === 'folder') {
                     $rowValue = $resourceObject->getParentFolder()->getReadablePath();
+                } elseif ($name === 'width') {
+                    $rowValue = $this->fileObject->getProperty('width') . 'px';
+                } elseif ($name === 'height') {
+                    $rowValue = $this->fileObject->getProperty('height') . 'px';
                 }
-            } elseif (in_array($name, ['creation_date', 'modification_date'], true)) {
+            } elseif ($name === 'creation_date' || $name === 'modification_date') {
                 $rowValue = BackendUtility::datetime($this->row[$name]);
             } else {
                 $rowValue = BackendUtility::getProcessedValueExtra($this->table, $name, $this->row[$name]);
index adcc18c..86b061f 100644 (file)
                        <trans-unit id="LGL.image">
                                <source>Image:</source>
                        </trans-unit>
+                       <trans-unit id="LGL.width">
+                               <source>Width</source>
+                       </trans-unit>
+                       <trans-unit id="LGL.height">
+                               <source>Height</source>
+                       </trans-unit>
                        <trans-unit id="LGL.caption">
                                <source>Caption:</source>
                        </trans-unit>