diff --git a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
index 9f91fa46674fc8f5f333ca6df666bed7a9e77588..82ef0445dd8cd0d4b7ae928057b1093f4ff88613 100644
--- a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
+++ b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
@@ -704,6 +704,9 @@ class GifBuilder extends GraphicalFunctions
         $filePrefix = implode('_', array_merge($this->combinedTextStrings, $this->combinedFileNames));
         $filePrefix = $basicFileFunctions->cleanFileName($filePrefix);
 
+        // shorten prefix to avoid overly long file names
+        $filePrefix = substr($filePrefix, 0, 100);
+
         return $this->tempPath . $pre . $filePrefix . '_' . GeneralUtility::shortMD5(serialize($this->setup)) . '.' . $this->extension();
     }