validateFileMimeType($file); $filename = $this->generateThumbnail($file); } $logoFile = $this->rootPath . '/config/minilogos/' . $thumbnailType . '_' . $element->getRootIdentifier() . '.jpg'; $custom_path = $this->rootPath . '/www/custom/minilogos/' . $thumbnailType . '_' . $element->getRootIdentifier() . '.jpg'; foreach ([$logoFile, $custom_path] as $target) { $this->copyFile($target, $filename); } $element->updateThumbnail($thumbnailType, $file); } /** * @param File $file * @return string */ protected function generateThumbnail(File $file) { $imageSpec = new ImageSpecification(); $this->setSpecificationSize($imageSpec, 120, 35); $filename = $this->resizeMediaFile($file, $imageSpec); return $filename; } }