Skip to content

Commit 3be0ac6

Browse files
committed
#100 - Normalize html/jpeg file extensions
1 parent 104448b commit 3be0ac6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/FileConverter.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,20 @@ public function getEngine($convert_path, $configuration) {
194194
}
195195

196196
public function getEngines($convert_path, $configuration_overrides = NULL, $confirm_available = TRUE) {
197+
// Normalize certain file extensions.
198+
$normalize = array(
199+
'htm' => 'html',
200+
'jpeg' => 'jpg',
201+
);
202+
$tmp = explode('->', $convert_path);
203+
foreach ($tmp as &$k) {
204+
if (isset($normalize[$k])) {
205+
$k = $normalize[$k];
206+
}
207+
}
208+
$convert_path = implode('->', $tmp);
209+
unset($k);
210+
197211
// Select a converter.
198212
$force_id = NULL;
199213
$engines = array();

0 commit comments

Comments
 (0)