Author: david
Date: Fri Feb 24 21:56:16 2012
New Revision: 10980
Log:
Make filenames lookup extension agnostic
Modified:
trunk/lib/task/archivematicaDipImportTask.class.php
Modified: trunk/lib/task/archivematicaDipImportTask.class.php
==============================================================================
--- trunk/lib/task/archivematicaDipImportTask.class.php Fri Feb 24 21:43:56
2012 (r10979)
+++ trunk/lib/task/archivematicaDipImportTask.class.php Fri Feb 24 21:56:16
2012 (r10980)
@@ -115,11 +115,11 @@
if (!file_exists($filepath))
{
// Substitute original image (TIFF) name with new DIP (JPEG) name
- $filename = basename($filepath);
+ $filename = strtolower(basename($filepath));
- if (isset($this->filenames[strtolower($filename)]))
+ if (isset($this->filenames[strstr($filename, '.', true)]))
{
- $filepath = str_replace($filename,
$this->filenames[strtolower($filename)], $filepath);
+ $filepath = str_replace($filename,
$this->filenames[strstr($filename, '.', true)], $filepath);
}
else
{
@@ -265,15 +265,8 @@
continue;
}
- $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;
+ // Key is original filename without extension
+ $this->filenames[$matches[1]] = $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.