exam-scan issueshttps://git.rwth-aachen.de/IENT/exam-scan/-/issues2021-10-09T09:43:28+02:00https://git.rwth-aachen.de/IENT/exam-scan/-/issues/4Can't use QR creator2021-10-09T09:43:28+02:00Ghost UserCan't use QR creatorWhen executing it, it says: `./qr_mark.sh: unrecognized option '--csv'`
I think it is not coded to input the csv.When executing it, it says: `./qr_mark.sh: unrecognized option '--csv'`
I think it is not coded to input the csv.https://git.rwth-aachen.de/IENT/exam-scan/-/issues/3Some pdf pages turn out black due to alpha channel2021-04-12T17:51:26+02:00Rafael GoldbeckSome pdf pages turn out black due to alpha channel**Edit:** I just realized that this version is not identical with the exam-scan version uploaded to git by RWTHmoodle... I was using the RWTHmoodle version where this issue occurred for pdf pages containing transparency layers. Not sure ...**Edit:** I just realized that this version is not identical with the exam-scan version uploaded to git by RWTHmoodle... I was using the RWTHmoodle version where this issue occurred for pdf pages containing transparency layers. Not sure whether this version yields the same problem.
--
Some pdf pages converted by watermark.py get an entirely black background in the current state of the script. Removing the transparency alpha channel worked out for me:
def watermark_img(img_file, template, dpi):
"""Watermarks image with watermark template
Args:
img_file (str): path to image file
template (PIL.Image.Image): watermark template
dpi (int): dots per inch
Returns:
str: path to watermarked image
"""
# Open image
image = Image.open(img_file).convert('RGBA')
image = remove_transparency(image) # <------------------ Add this line in watermark_img call
width, height = image.size
[...]
def remove_transparency(im, bg_colour=(255, 255, 255)): # <------------------ Add this function
# Only process if image has transparency
if im.mode in ('RGBA', 'LA') or (im.mode == 'P' and 'transparency' in im.info):
# Need to convert to RGBA if LA format due to a bug in PIL
alpha = im.convert('RGBA').split()[-1]
# Create a new background image of our matt color.
# Must be RGBA because paste requires both images have the same format
bg = Image.new("RGBA", im.size, bg_colour + (255,))
bg.paste(im, mask=alpha)
return bg
else:
return im