|
|
|
@@ -50,13 +50,13 @@ for r in relevant: |
|
|
|
|
|
|
|
#print(pagetype, orig_file_name, rotation, skew, apply_skew, crop_x, crop_y, crop_w, crop_h) |
|
|
|
|
|
|
|
skew_r = math.radians(-skew) |
|
|
|
skew_r = math.radians(skew) |
|
|
|
|
|
|
|
if apply_skew: |
|
|
|
top_l = (crop_x, crop_y) |
|
|
|
top_r = (crop_x + crop_w * math.cos(skew_r), crop_y + crop_w * math.sin(skew_r)) |
|
|
|
top_r = (crop_x + crop_w * math.cos(skew_r), crop_y - crop_w * math.sin(skew_r)) |
|
|
|
bottom_l = (crop_x + crop_h * math.sin(skew_r), crop_y + crop_h * math.cos(skew_r)) |
|
|
|
bottom_r = (top_r[0], bottom_l[1] + crop_w * math.sin(skew_r)) |
|
|
|
bottom_r = (top_r[0], bottom_l[1] - crop_w * math.sin(skew_r)) |
|
|
|
else: |
|
|
|
top_l = (crop_x, crop_y) |
|
|
|
top_r = (crop_x + crop_w, crop_y) |
|
|
|
|