Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/extract-images/extract-from-pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

Changes
-------
* 2024-03-29: update progress meter function call
* 2021-09-17: remove PIL and use extended pixmap features instead
* 2020-10-04: for images with an /SMask, we use Pillow to recover original
* 2020-11-21: convert cases with special /ColorSpace definitions to RGB PNG
Expand Down Expand Up @@ -121,11 +122,12 @@ def recoverpix(doc, item):
xreflist = []
imglist = []
for pno in range(page_count):
sg.QuickMeter(
sg.one_line_progress_meter(
"Extract Images", # show our progress
pno + 1,
page_count,
"*** Scanning Pages ***",
orientation = "h",
)

il = doc.get_page_images(pno)
Expand Down
6 changes: 4 additions & 2 deletions examples/extract-images/extract-from-xref.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@

Changes
--------
2021-09-17: Removed PIL dependency
* 2024-03-29: update progress meter function call
* 2021-09-17: Removed PIL dependency
"""

from __future__ import print_function
Expand Down Expand Up @@ -116,11 +117,12 @@ def recoverpix(doc, x, imgdict):
# loop through PDF images
# ------------------------------------------------------------------------------
for xref in range(1, lenXREF): # scan through all PDF objects
sg.QuickMeter(
sg.one_line_progress_meter(
"Extract Images", # show our progress
xref,
lenXREF,
"*** Scanning Cross Reference ***",
orientation = "h",
)

if doc.xref_get_key(xref, "Subtype")[1] != "/Image": # not an image
Expand Down