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

[Bug] Every Other Page are Gray Pages(PDF Issue) #540

Closed
derzz opened this issue Jun 11, 2023 · 13 comments · Fixed by #546
Closed

[Bug] Every Other Page are Gray Pages(PDF Issue) #540

derzz opened this issue Jun 11, 2023 · 13 comments · Fixed by #546
Labels
Kobo Kobo device

Comments

@derzz
Copy link

derzz commented Jun 11, 2023

Hi,

I'm trying to convert a manga from PDF to EPub and every time I convert, every other page in the epub file contains a page filled with gray. I'm using a Kobo Clara HD with Manga Mode, Stretch/Upscale, and Cropping Mode with the power at 1.00x enabled. Is this a bug or is there an option that I can enable to get rid of this issue?

Eg. Every page has the actual manga content like so:
image

But then a gray page like this appears:
image

And this pattern repeats for the whole ePub file.

@derzz derzz changed the title [Bug] Every Other Page are Black Bars [Bug] Every Other Page are Gray Pages Jun 11, 2023
@darodi darodi added the Kobo Kobo device label Jun 12, 2023
@axu2
Copy link
Collaborator

axu2 commented Jun 17, 2023

If you open the epub on a PC do you still see the gray pages? The pdf might just have small gray images...

Unzip the epub and look in the images folder.

@derzz
Copy link
Author

derzz commented Jun 17, 2023

So on Calibre and when unzipping the epub, the gray pages are still there. I'm looking at the pdf and there doesn't seem to have small gray images in there other than the manga being black and white.

@axu2
Copy link
Collaborator

axu2 commented Jun 17, 2023

Are pages being replaced with gray? Or are additional gray pages being added?

@derzz
Copy link
Author

derzz commented Jun 17, 2023

Additional gray pages are being added.

@axu2
Copy link
Collaborator

axu2 commented Jun 17, 2023

Hmmm, my suspicion is that it's a problem with the source file. Are you able to obtain a CBZ instead (which can be unzipped as well)? Or an image folder? Can you test with just a folder of random .jpgs to see if you still get it? Or upload the source file here, or at least a couple pages?

@derzz
Copy link
Author

derzz commented Jun 17, 2023

So when I obtain the CBZ, it still is producing the same issues. The issue isn't here with a random JPG folder. Attached are some pages of the PDF, let me know if you need more information. Even testing the pdf with some pages attached still produces the gray pages.
よつばと! 第01巻_removed.pdf

@axu2
Copy link
Collaborator

axu2 commented Jun 18, 2023

I'll test myself soon. In the meantime, are you on the latest stable version 5.6.2?

@derzz
Copy link
Author

derzz commented Jun 18, 2023 via email

@axu2
Copy link
Collaborator

axu2 commented Jun 18, 2023

A single gray pixel is being generated between pages.
image

The pdf file must have stray single gray pixels between pages... Are you able to get a better source?

@derzz
Copy link
Author

derzz commented Jun 18, 2023

Sorry, I don't have a better source for this :(

Is there a way to delete these files, I'm fine if I have to manually do it, but if I manually delete each single gray pixel file, how would I repackage the image files into an epub?

@axu2
Copy link
Collaborator

axu2 commented Jun 18, 2023

I would try another program to extract the images out of the pdf. And then use the extracted file in KCC.

If you feel brave try editing pdfjpgextract.py

@axu2
Copy link
Collaborator

axu2 commented Jun 18, 2023

Can you test #546 @derzz

I was testing the sizes of the images in pdf and got this. But this is obviously a very small test case.

And this is very hacky, please fix up the PR when you finish testing with comments.

Alternatively, there's probably a better way to extract images in 2023, that code hasn't been touched in like 10 years probably.

642423
160
302131
159
317957
160

And please change the title to reflect that's it's a pdf issue

@derzz derzz changed the title [Bug] Every Other Page are Gray Pages [Bug] Every Other Page are Gray Pages(PDF Issue) Jun 20, 2023
@derzz
Copy link
Author

derzz commented Jun 20, 2023

Sorry, but what should I do with #546? I have the release version right now and there's no python file for me to edit in the release. Can you elaborate on what I should do to test this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kobo Kobo device
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants