File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 2626use TYPO3 \CMS \Core \Messaging \FlashMessageService ;
2727use TYPO3 \CMS \Core \Messaging \FlashMessageQueue ;
2828use TYPO3 \CMS \Core \Resource \MimeTypeCollection ;
29+ use TYPO3 \CMS \Core \Resource \MimeTypeDetector ;
2930use TYPO3 \CMS \Core \Utility \ArrayUtility ;
3031use TYPO3 \CMS \Core \Utility \GeneralUtility ;
3132use TYPO3 \CMS \Core \Utility \MathUtility ;
Original file line number Diff line number Diff line change @@ -145,7 +145,11 @@ private function getImage(int $page): array
145145 $ image = $ this ->getFile ($ page , $ this ->useGroupsConfiguration ->getImage ());
146146 if (isset ($ image ['mimetype ' ])) {
147147 $ fileExtension = Helper::getFileExtensionsForMimeType ($ image ['mimetype ' ]);
148- $ image ['mimetypeLabel ' ] = !empty ($ fileExtension ) ? ' ( ' . strtoupper ($ fileExtension [0 ]) . ') ' : '' ;
148+ if ($ image ['mimetype ' ] == 'image/jpg ' ) {
149+ $ image ['mimetypeLabel ' ] = ' (JPG) ' ; // "image/jpg" is not a valid MIME type, so we need to handle it separately.
150+ } else {
151+ $ image ['mimetypeLabel ' ] = !empty ($ fileExtension ) ? ' ( ' . strtoupper ($ fileExtension [0 ]) . ') ' : '' ;
152+ }
149153 }
150154 return $ image ;
151155 }
You can’t perform that action at this time.
0 commit comments