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

skip single pixel images in PDF #546

Merged
merged 3 commits into from
Aug 5, 2023
Merged

Conversation

axu2
Copy link
Collaborator

@axu2 axu2 commented Jun 18, 2023

@axu2 axu2 changed the title skip pixels hopefully skip single pixel pages Jun 18, 2023
@derzz
Copy link

derzz commented Jun 20, 2023

Ok so good news is that it fixed the majority of the pages. However, there are still some pages in my manga that are showing these gray pixels again. Here's the pages that are having this issue again. Nonetheless, thank you for your work so far!
よつばと! 第01巻_removed.pdf

@axu2
Copy link
Collaborator Author

axu2 commented Jun 20, 2023

@derzz Can you add this line to the code:

print(iend-istart)

and adjust the thresholds as appropriate based on what you see?

In my case, image lengths were:

642423
160
302131
159
317957
160

Skipping images based on size is REALLY hacky though. Feel free to look into better pdf jpg extraction methods.

@derzz
Copy link

derzz commented Jun 20, 2023

Ok, I got it now, I changed the boundaries to 287 since some image lengths were being to that number. Nonetheless, skipping images by these sizes should be fine since these are small values compared to the manga's pages whose full length should be in the thousands. Thank you so much for your help! :)

@axu2 axu2 closed this Jun 20, 2023
@axu2 axu2 reopened this Jun 25, 2023
@axu2 axu2 marked this pull request as ready for review June 25, 2023 04:10
@axu2 axu2 changed the title skip single pixel pages skip single pixel pages in PDF Jun 25, 2023
@axu2 axu2 changed the title skip single pixel pages in PDF skip single pixel images in PDF Jun 27, 2023
@darodi darodi self-requested a review July 5, 2023 16:59
Copy link
Collaborator

@darodi darodi left a comment

Choose a reason for hiding this comment

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

testing this and then merging

@darodi darodi merged commit 9339abb into ciromattia:master Aug 5, 2023
@darodi darodi added this to the 5.6.3 milestone Aug 5, 2023
@darodi darodi added the Bug Something isn't working label Aug 5, 2023
@axu2 axu2 deleted the skip-pdf-pixels branch August 5, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Every Other Page are Gray Pages(PDF Issue)
3 participants