public function PDFPreviewGenerator::updatePDFPreview in PDFPreview 8
Same name and namespace in other branches
- 2.0.x src/PdfPreviewGenerator.php \Drupal\pdfpreview\PdfPreviewGenerator::updatePdfPreview()
Deletes the preview image for a file when the file is updated.
Parameters
\Drupal\file\Entity\File $file: The file to delete the preview for.
File
- src/
PDFPreviewGenerator.php, line 117
Class
- PDFPreviewGenerator
- Generates PDF Previews.
Namespace
Drupal\pdfpreviewCode
public function updatePDFPreview(File $file) {
/** @var \Drupal\file\Entity\File $original */
$original = $file->original;
if ($file
->getFileUri() != $original
->getFileUri() || filesize($file
->getFileUri()) != filesize($original
->getFileUri())) {
$this
->deletePDFPreview($original);
}
}