Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Extend images interface by returning an ImageFile(File) class #1848

Merged
merged 37 commits into from
Jun 13, 2023

Conversation

pubpub-zz
Copy link
Collaborator

@pubpub-zz pubpub-zz commented May 20, 2023

Extends the current image with new attributes (image/indirect_reference).

Allows extension for Inline Images, and image replacement

For the Reviewer

@pubpub-zz
Copy link
Collaborator Author

pubpub-zz commented May 20, 2023

I've reported the merge and select what I wanted. the history is not so good

I will also isolate a new PR for Inline Image and also Image replacement (to reduce file size specially)
Also the test coverage will be fixed with the other

@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Patch coverage: 91.20% and project coverage change: -0.05 ⚠️

Comparison is base (b128846) 93.77% compared to head (b64088e) 93.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1848      +/-   ##
==========================================
- Coverage   93.77%   93.73%   -0.05%     
==========================================
  Files          34       34              
  Lines        6720     6795      +75     
  Branches     1320     1338      +18     
==========================================
+ Hits         6302     6369      +67     
- Misses        272      279       +7     
- Partials      146      147       +1     
Impacted Files Coverage Δ
pypdf/_page.py 91.44% <87.69%> (-0.50%) ⬇️
pypdf/_utils.py 100.00% <100.00%> (ø)
pypdf/filters.py 95.85% <100.00%> (+0.20%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pubpub-zz pubpub-zz changed the title ENH : extend Image interface ENH: extend images interface May 20, 2023
@pubpub-zz
Copy link
Collaborator Author

pubpub-zz commented May 23, 2023

@MartinThoma
All yours,
coverage will be fixed with other PRs
First PR to merge

pypdf/_utils.py Outdated


@dataclass
class FileImage(File):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename it to ImageFile?

@MartinThoma MartinThoma added the soon PRs that are almost ready to be merged, issues that get solved pretty soon label Jun 13, 2023
@MartinThoma MartinThoma changed the title ENH: extend images interface ENH: Extend images interface Jun 13, 2023
@MartinThoma MartinThoma changed the title ENH: Extend images interface ENH: Extend images interface by returning an ImageFile(File) class Jun 13, 2023
@MartinThoma MartinThoma merged commit 4b6d864 into py-pdf:main Jun 13, 2023
MartinThoma added a commit that referenced this pull request Jun 18, 2023
New Features (ENH):
-  Extraction of inline images (#1850)
-  Add capability to replace image (#1849)
-  Extend images interface by returning an ImageFile(File) class (#1848)
-  Add set_data to EncodedStreamObject (#1854)

Bug Fixes (BUG):
-  Fix RGB FlateEncode Images(PNG) and transparency (#1834)
-  Generate static appearance for fields (#1864)

[Full Changelog](3.9.1...3.10.0)
@pubpub-zz pubpub-zz deleted the image_intf branch September 2, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
soon PRs that are almost ready to be merged, issues that get solved pretty soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants