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

[OPDS] Image link should return full-sized custom thumbnail if set #1099

Closed
5 tasks done
awh-tokyo opened this issue Mar 21, 2023 · 4 comments
Closed
5 tasks done

[OPDS] Image link should return full-sized custom thumbnail if set #1099

awh-tokyo opened this issue Mar 21, 2023 · 4 comments
Labels
bug Something isn't working released

Comments

@awh-tokyo
Copy link
Contributor

Steps to reproduce

  1. Access the OPDS catalog and view an entry for any book without a custom poster set
  2. Access the "image/thumbnail" link and note that it's a thumbnail of the first page
  3. Access the "image" link and note that it's a the first page of the book
  4. In the GUI, change that book's poster to a custom image
  5. Access the OPDS catalog again

Expected behavior

The "image" link should be the original image uploaded as the custom poster, and the "image/thumbnail" link should be a thumbnail version of the same image.

Actual behavior

Although the "image/thumbnail" link contents have changed, it's a full-size image, not a thumbnail, and the "image" link is still the first page of the book.

Logs

No response

Komga version

0.163.0

Operating system

Linux, running the docker image

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 gotson added cannot reproduce The situation cannot be reproduced by the developers and removed triage labels Mar 21, 2023
@gotson
Copy link
Owner

gotson commented Mar 21, 2023

The links will not change, however the content returned by the image/thumbnail link changes. I just tried and it works as expected.

Are you testing via an OPDS client, or directly via the browser ?

@awh-tokyo
Copy link
Contributor Author

awh-tokyo commented Mar 21, 2023

I'm testing via a browser, but I tried clearing the cache and then using a different browser entirely so I don't think it's a caching issue.

The "image/thumbnail" contents do change when I upload a custom cover, though the returned image seems to be full-resolution for me, not a smaller version. That may be by design.

However, the "image" link remains a link to the first page of the book which still shows the original artwork:

<link type="image/jpeg" rel="http://opds-spec.org/image/thumbnail" href="/opds/v1.2/books/09ZF85SYB236B/thumbnail"/>
<link type="image/jpeg" rel="http://opds-spec.org/image" href="/opds/v1.2/books/09ZF85SYB236B/pages/1"/>

My expectation would have been that the "image" link would return the full-size poster image (either page 1 of the book, or whatever the user has uploaded through the edit book dialog), and the "image/thumbnail" would return a lower-resolution version of the same image.

@gotson
Copy link
Owner

gotson commented Mar 21, 2023

I finally understood what you meant, sorry about that.

The spec says:

OPDS Catalog Entries may include atom:link elements to images that provide a visual representation of the Publication. For many Publications, these images will be the Publication’s artwork. This specification defines two Artwork Relations, which begin with http://opds-spec.org/image:

http://opds-spec.org/image: a graphical Resource associated to the OPDS Catalog Entry
http://opds-spec.org/image/thumbnail: a reduced-size version of a graphical Resource associated to the OPS Catalog Entry

The spec is vague enough so that whatever image could be used. However, the image/thumbnail should be the reduced-size version of the image link.

Which is not what is happening now.

So it could go one of 2 ways:

  • either always display the first page, and forego custom thumbnails. It would be valid as per OPDS spec, but not in line with the rest of Komga.
  • or have a way to provide the full size equivalent of the thumbnail.

Point 2 is what you suggest, however i can't remember whether Komga keeps the full size image in various cases.

In addition, the thumbnail endpoint for custom poster returns the full size of that image. It works for generated thumbnails because they have been resized already, but not for custom covers.

@gotson gotson added bug Something isn't working and removed cannot reproduce The situation cannot be reproduced by the developers labels Mar 21, 2023
@gotson gotson changed the title [OPDS] Image link always returns first page even in books with custom poster [OPDS] Image link should return full-sized custom thumbnail if set Mar 21, 2023
@gotson gotson closed this as completed in 4a3e394 Jun 28, 2023
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 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