Author: david
Date: Thu Feb 23 16:41:14 2012
New Revision: 10965
Log:
Adapt script for audio and video formats
Modified:
trunk/lib/task/archivematicaDipImportTask.class.php
Modified: trunk/lib/task/archivematicaDipImportTask.class.php
==============================================================================
--- trunk/lib/task/archivematicaDipImportTask.class.php Thu Feb 23 16:14:35
2012 (r10964)
+++ trunk/lib/task/archivematicaDipImportTask.class.php Thu Feb 23 16:41:14
2012 (r10965)
@@ -258,15 +258,22 @@
foreach ($files as $file)
{
// Format should be UUID (37 hex chars or hyphen) + filename + '.jpg'
- $pattern = '/^[0-9a-f-]{37}(.+)\.jpg$/';
+ $pattern = '/^[0-9a-f-]{37}(.+)\.(\w{3})$/';
if (is_dir($file) || !preg_match($pattern, strtolower($file), $matches))
{
continue;
}
- // Key is original TIFF name
- $this->filenames[$matches[1].'.tif'] = $file;
+ $extensionMap = array(
+ 'jpg' => 'tif',
+ 'mp3' => 'wav',
+ 'mp4' => 'mpg',
+ 'mpg' => 'mpg'
+ );
+
+ // Key is original filename with appropriate extension (tif, wav, mp4,
etc.)
+ $this->filenames[$matches[1].'.'.$extensionMap[$matches[2]] = $file;
}
}
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.