-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Problem/Motivation
Deepl support document minification: Deepl document minification: https://github.com/DeepLcom/deepl-php?tab=readme-ov-file#document-minification
However, translating a .docx or .pptx file currently results in an exception when the input file has no media
Steps to reproduce
- Create a docx with a single word 'test'
- Call \DeepL\Translator::translateDocument with $options[TranslateDocumentOptions::ENABLE_DOCUMENT_MINIFICATION]
- Notice the call results in an exception:
UnexpectedValueException: RecursiveDirectoryIterator::__construct(/var/folders/7c/83djllx9041g_r31cy6w3w280000gn/T/document_minification_693ae127272c6/original_media): Failed to open directory: No such file or directory in RecursiveDirectoryIterator->__construct() (line 309 of vendor/deeplcom/deepl-php/src/DocumentMinifier.php). DeepL\DocumentMinifier->replaceImagesInDir('/var/folders/7c/83djllx9041g_r31cy6w3w280000gn/T/document_minification_693ae127272c6/extracted_doc', '/var/folders/7c/83djllx9041g_r31cy6w3w280000gn/T/document_minification_693ae127272c6/original_media') (Line: 205)
Proposed resolution
Check if the original media directory is available
User interface changes
None
API changes
None
Data model changes
None
Metadata
Metadata
Assignees
Labels
No labels