-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
14 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,12 +90,12 @@ def get_pos(self): | |
if self.page is None: | ||
raise RuntimeError("Must not call get_pos() on a loose pageobject.") | ||
|
||
left, bottom, right, top = c_float(), c_float(), c_float(), c_float() | ||
success = pdfium_c.FPDFPageObj_GetBounds(self, left, bottom, right, top) | ||
l, b, r, t = c_float(), c_float(), c_float(), c_float() | ||
success = pdfium_c.FPDFPageObj_GetBounds(self, l, b, r, t) | ||
if not success: | ||
raise PdfiumError("Failed to locate pageobject.") | ||
|
||
return (left.value, bottom.value, right.value, top.value) | ||
return (l.value, b.value, r.value, t.value) | ||
|
||
|
||
def get_matrix(self): | ||
|
@@ -207,11 +207,7 @@ def load_jpeg(self, source, pages=None, inline=False, autoclose=True): | |
raise ValueError(f"Cannot load JPEG from {source} - not a file path or byte buffer.") | ||
|
||
bufaccess, ld_data = utils.get_bufreader(buffer) | ||
|
||
if inline: | ||
loader = pdfium_c.FPDFImageObj_LoadJpegFileInline | ||
else: | ||
loader = pdfium_c.FPDFImageObj_LoadJpegFile | ||
loader = pdfium_c.FPDFImageObj_LoadJpegFileInline if inline else pdfium_c.FPDFImageObj_LoadJpegFile | ||
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
mara004
Author
Member
|
||
|
||
c_pages, page_count = utils.pages_c_array(pages) | ||
success = loader(c_pages, page_count, self, bufaccess) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changing
inline(=False)
tobuffered(=True)
and swapping loaders here (i. e. handling the default first) might be slightly nicer. However, we probably shouldn't do this, not even on a major release, on behalf of API stability.