diff documentViewer.py @ 562:60f5a636bc57

bugfixes for stability.
author casties
date Tue, 02 Oct 2012 15:22:11 +0200
parents 9255acc4518d
children 31f562fa7214
line wrap: on
line diff
--- a/documentViewer.py	Mon Oct 01 18:09:01 2012 +0200
+++ b/documentViewer.py	Tue Oct 02 15:22:11 2012 +0200
@@ -558,10 +558,10 @@
             # asssume index.meta in parent dir
             docUrl = getParentPath(url)
             metaDom = self.metadataService.getDomFromPathOrUrl(docUrl)
+            docinfo['imagePath'] = url.replace('/mpiwg/online/', '', 1)
 
         elif mode=="filepath":
             # url points to image file, index.meta optional
-            docinfo['imagePath'] = url
             docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + url
             docinfo['numPages'] = 1
             # asssume index.meta is two path segments up
@@ -635,8 +635,9 @@
         if docinfo.get('numPages', 0) == 0:
             # number of images from digilib
             if docinfo.get('imagePath', None):
-                docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + docinfo['imagePath']
-                docinfo = self.getDocinfoFromDigilib(docinfo, docinfo['imagePath'])
+                imgpath = docinfo['imagePath'].replace('/mpiwg/online/', '', 1)
+                docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + imgpath
+                docinfo = self.getDocinfoFromDigilib(docinfo, imgpath)
             else:
                 # imagePath still missing? try "./pageimg"
                 imgPath = os.path.join(docUrl, 'pageimg')
@@ -695,7 +696,6 @@
         imageDir = getMDText(texttool.get('image', None))
         docPath = getMDText(docinfo.get('documentPath', None))
         if imageDir and docPath:
-            #print "image: ", imageDir, " archivepath: ", archivePath
             imageDir = os.path.join(docPath, imageDir)
             imageDir = imageDir.replace('/mpiwg/online', '', 1)
             docinfo['imagePath'] = imageDir