aboutsummaryrefslogtreecommitdiffstats
path: root/python/sandcrawler/pdfextract.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-25 17:23:06 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-25 17:23:06 -0700
commit585e0ba76687ae2872faed88bd1edc5b051136ca (patch)
tree332d1915873717bfa440e872dcce457c71c91346 /python/sandcrawler/pdfextract.py
parentb150a62569a972b2719da71403b744bafa4f3fb6 (diff)
downloadsandcrawler-585e0ba76687ae2872faed88bd1edc5b051136ca.tar.gz
sandcrawler-585e0ba76687ae2872faed88bd1edc5b051136ca.zip
poppler: correct RGBA buffer endian-ness
Diffstat (limited to 'python/sandcrawler/pdfextract.py')
-rw-r--r--python/sandcrawler/pdfextract.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/sandcrawler/pdfextract.py b/python/sandcrawler/pdfextract.py
index 4606632..6a78a0a 100644
--- a/python/sandcrawler/pdfextract.py
+++ b/python/sandcrawler/pdfextract.py
@@ -158,7 +158,7 @@ def process_pdf(blob: bytes, thumb_size=(180,300), thumb_type="JPEG") -> PdfExtr
renderer = poppler.PageRenderer()
try:
full_img = renderer.render_page(page0)
- img = Image.frombuffer("RGBA", (full_img.width, full_img.height), full_img.data, 'raw', "RGBA", 0, 1)
+ img = Image.frombuffer("RGBA", (full_img.width, full_img.height), full_img.data, 'raw', "BGRA", 0, 1)
img.thumbnail(thumb_size, Image.BICUBIC)
buf = BytesIO()
img.save(buf, thumb_type)