You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Translating a document with minification fails if the original file has no media #73
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
Activity
Issue DeepL#73: Translating a document with minification fails if the…