|
@@ -108,13 +108,13 @@ print( '---------- Processing cover page ----------' )
|
|
|
# First convert the cover-page as it should be number one
|
|
|
subprocess.call('../PageNormalizer/build-Mac/PageNormalizer ' + \
|
|
|
' -i ' + covFilePath + \
|
|
|
- ' -o ' + tpath+'/temp.jpg' + \
|
|
|
+ ' -o ' + tpath+'/temp.bmp' + \
|
|
|
' -wref ' + tpath + '/ref_white.jpg' + \
|
|
|
' -bref ' + tpath + '/ref_black.jpg' + \
|
|
|
' -s ' + settingsFile , shell=True)
|
|
|
|
|
|
# Rotate the image and store it in the final position (output-folder)
|
|
|
-subprocess.call('jpegtran -rotate 270 -outfile ' + opath + '/page_'+str(1).zfill(numberNumericalsInName)+'.jpg ' + tpath+'/temp.jpg', shell=True)
|
|
|
+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
|
|
@@ -125,13 +125,13 @@ for i in range( len(lHandSides) ):
|
|
|
subprocess.call('../PageNormalizer/build-Mac/PageNormalizer ' + \
|
|
|
' -q ' \
|
|
|
' -i ' + lHandSides[i] + \
|
|
|
- ' -o ' + tpath+'/temp.jpg' + \
|
|
|
+ ' -o ' + tpath+'/temp.bmp' + \
|
|
|
' -wref ' + tpath + '/ref_white.jpg' + \
|
|
|
' -bref ' + tpath + '/ref_black.jpg' + \
|
|
|
' -s ' + settingsFile , shell=True)
|
|
|
|
|
|
# Rotate the image
|
|
|
- subprocess.call('jpegtran -rotate 90 -outfile ' + opath + '/page_'+str(leftPageNo).zfill(numberNumericalsInName)+'.jpg ' + tpath+'/temp.jpg', shell=True)
|
|
|
+ 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)
|
|
|
|
|
|
|
|
|
leftPageNo = leftPageNo + 2 # Increase the page conter
|
|
@@ -144,13 +144,13 @@ for i in range( len(rHandSides) ):
|
|
|
subprocess.call('../PageNormalizer/build-Mac/PageNormalizer ' + \
|
|
|
' -q ' \
|
|
|
' -i ' + rHandSides[i] + \
|
|
|
- ' -o ' + tpath+'/temp.jpg' + \
|
|
|
+ ' -o ' + tpath+'/temp.bmp' + \
|
|
|
' -wref ' + tpath + '/ref_white.jpg' + \
|
|
|
' -bref ' + tpath + '/ref_black.jpg' + \
|
|
|
' -s ' + settingsFile , shell=True)
|
|
|
|
|
|
# Rotate the image
|
|
|
- subprocess.call('jpegtran -rotate 270 -outfile ' + opath + '/page_'+str(rightPageNo).zfill(numberNumericalsInName)+'.jpg ' + tpath+'/temp.jpg', shell=True)
|
|
|
+ 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)
|
|
|
|
|
|
rightPageNo = rightPageNo + 2 # Increase the page conter
|
|
|
|