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

PDFs streaming PDF binary pages instead of images #1262

Closed
5 tasks done
DaveAlton opened this issue Oct 20, 2023 · 4 comments
Closed
5 tasks done

PDFs streaming PDF binary pages instead of images #1262

DaveAlton opened this issue Oct 20, 2023 · 4 comments
Labels
bug Something isn't working released

Comments

@DaveAlton
Copy link

DaveAlton commented Oct 20, 2023

Steps to reproduce

It looks like the server is not behaving like expected.

This is an example of a streaming URL
https://[server_domain]/opds/v1.2/books/0BSERXJ3JF6AW/pages/0?zero_based=true

M Komga server is returning

{
  "timestamp": "2023-10-20T17:37:04.182+00:00",
  "status": 400,
  "error": "Bad Request",
  "message": "Page number does not exist",
  "path": "/opds/v1.2/books/0BSERXJ3JF6AW/pages/0"
}

When it's a PDF. I tried tweaking the URL to https://[server_domain]/opds/v1.2/books/0BSERXJ3JF6AW/pages/1?zero_based=true
and it responds, but the response is not an image. It returns binary data that seems to be a PDF binary becuase the data starts with

%PDF-1.4
%öäüß
1 0 obj
<<
/Type /Catalog
/Version /1.4
/Pages 2 0 R
>>
...

OPDS PSE only accepts jpeg, png and gif as a response. So even if the page index issue is solved, the returning data is still wrong.

Expected behavior

PDF page streaming should return jpeg, png or gif

Actual behavior

Seems to be streaming a PDF binary

Logs

No response

Komga version

1.6.2

Operating system

MacOS

Other details

No response

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have checked the FAQ.
  • I have updated the app to the latest version.
  • I will fill out all of the requested information in this form.
@gotson
Copy link
Owner

gotson commented Oct 21, 2023

Which client are you using, and what request headers is it sending?

@DaveAlton
Copy link
Author

DaveAlton commented Oct 21, 2023 via email

@gotson gotson added bug Something isn't working and removed triage labels Oct 21, 2023
@gotson
Copy link
Owner

gotson commented Oct 21, 2023

Thanks for the details, I'll look into it.

@gotson gotson closed this as completed in 084997f Oct 26, 2023
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in v1.6.4 (Release Notes)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants