|
@@ -105,19 +105,16 @@ rightPageNo = pageNoOfFirstLeftPage+1
|
|
|
|
|
|
print( '---------- Processing cover page ----------' )
|
|
|
|
|
|
-# First convert the cover-page as it should be number one
|
|
|
+# ------ First convert the cover-page as it should be number one
|
|
|
subprocess.call('../PageNormalizer/build-Mac/PageNormalizer ' + \
|
|
|
' -i ' + covFilePath + \
|
|
|
- ' -o ' + tpath+'/temp.bmp' + \
|
|
|
+ ' -o ' + opath + '/page_'+str(1).zfill(numberNumericalsInName)+'.bmp ' + \
|
|
|
' -wref ' + tpath + '/ref_white.jpg' + \
|
|
|
' -bref ' + tpath + '/ref_black.jpg' + \
|
|
|
- ' -s ' + settingsFile , shell=True)
|
|
|
+ ' -s ' + settingsFile + \
|
|
|
+ ' -r 270', shell=True)
|
|
|
|
|
|
-# Rotate the image and store it in the final position (output-folder)
|
|
|
-subprocess.call( 'sips -r 270 -s dpiHeight 200.0 -s dpiWidth 200.0 temp/temp.bmp --out ' + opath + '/page_'+str(1).zfill(numberNumericalsInName)+'.bmp ', shell=True)
|
|
|
-
|
|
|
-
|
|
|
-# Start doing the rest of the pages. Left pages first
|
|
|
+# ------ Start doing the rest of the pages. Left pages first
|
|
|
for i in range( len(lHandSides) ):
|
|
|
|
|
|
# Process it
|
|
@@ -125,18 +122,15 @@ for i in range( len(lHandSides) ):
|
|
|
subprocess.call('../PageNormalizer/build-Mac/PageNormalizer ' + \
|
|
|
' -q ' \
|
|
|
' -i ' + lHandSides[i] + \
|
|
|
- ' -o ' + tpath+'/temp.bmp' + \
|
|
|
+ ' -o ' + opath + '/page_'+str(leftPageNo).zfill(numberNumericalsInName)+'.bmp ' + \
|
|
|
' -wref ' + tpath + '/ref_white.jpg' + \
|
|
|
' -bref ' + tpath + '/ref_black.jpg' + \
|
|
|
- ' -s ' + settingsFile , shell=True)
|
|
|
-
|
|
|
- # Rotate the image
|
|
|
- subprocess.call( 'sips -r 90 -s dpiHeight 200.0 -s dpiWidth 200.0 temp/temp.bmp --out ' + opath + '/page_'+str(leftPageNo).zfill(numberNumericalsInName)+'.bmp ', shell=True)
|
|
|
-
|
|
|
+ ' -s ' + settingsFile + \
|
|
|
+ ' -r 90', shell=True)
|
|
|
|
|
|
leftPageNo = leftPageNo + 2 # Increase the page conter
|
|
|
|
|
|
-# Continue with the rest of the right hand pages
|
|
|
+# ------ Continue with the rest of the right hand pages
|
|
|
for i in range( len(rHandSides) ):
|
|
|
|
|
|
# Right page after. Process it
|
|
@@ -144,13 +138,11 @@ for i in range( len(rHandSides) ):
|
|
|
subprocess.call('../PageNormalizer/build-Mac/PageNormalizer ' + \
|
|
|
' -q ' \
|
|
|
' -i ' + rHandSides[i] + \
|
|
|
- ' -o ' + tpath+'/temp.bmp' + \
|
|
|
+ ' -o ' + opath + '/page_'+str(rightPageNo).zfill(numberNumericalsInName)+'.bmp ' + \
|
|
|
' -wref ' + tpath + '/ref_white.jpg' + \
|
|
|
' -bref ' + tpath + '/ref_black.jpg' + \
|
|
|
- ' -s ' + settingsFile , shell=True)
|
|
|
-
|
|
|
- # Rotate the image
|
|
|
- subprocess.call( 'sips -r 270 -s dpiHeight 200.0 -s dpiWidth 200.0 temp/temp.bmp --out ' + opath + '/page_'+str(rightPageNo).zfill(numberNumericalsInName)+'.bmp ', shell=True)
|
|
|
+ ' -s ' + settingsFile + \
|
|
|
+ ' -r 270', shell=True)
|
|
|
|
|
|
rightPageNo = rightPageNo + 2 # Increase the page conter
|
|
|
|