Commit
·
a680619
1
Parent(s):
ebf9010
Allowed for PIL to load truncated images to avoid some load errors
Browse files- tools/file_conversion.py +3 -1
- tools/file_redaction.py +3 -1
tools/file_conversion.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
from pdf2image import convert_from_path, pdfinfo_from_path
|
2 |
from tools.helper_functions import get_file_path_end, output_folder, detect_file_type
|
3 |
-
from PIL import Image
|
|
|
|
|
4 |
import os
|
5 |
import time
|
6 |
import json
|
|
|
1 |
from pdf2image import convert_from_path, pdfinfo_from_path
|
2 |
from tools.helper_functions import get_file_path_end, output_folder, detect_file_type
|
3 |
+
from PIL import Image, ImageFile
|
4 |
+
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
5 |
+
|
6 |
import os
|
7 |
import time
|
8 |
import json
|
tools/file_redaction.py
CHANGED
@@ -3,7 +3,9 @@ import re
|
|
3 |
import json
|
4 |
import io
|
5 |
import os
|
6 |
-
from PIL import Image, ImageChops,
|
|
|
|
|
7 |
from typing import List, Dict, Tuple
|
8 |
import pandas as pd
|
9 |
|
|
|
3 |
import json
|
4 |
import io
|
5 |
import os
|
6 |
+
from PIL import Image, ImageChops, ImageFile
|
7 |
+
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
8 |
+
|
9 |
from typing import List, Dict, Tuple
|
10 |
import pandas as pd
|
11 |
|