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

Scale of image #1

Open
Iskander1220 opened this issue Apr 5, 2021 · 4 comments
Open

Scale of image #1

Iskander1220 opened this issue Apr 5, 2021 · 4 comments

Comments

@Iskander1220
Copy link

Hi, AdeelK93, and sorry for my english!

Do I understand correctly that on this link (https://github.com/AdeelK93/wapo_pdf/blob/823139583d49f48f7dadc650cd50266eba1a1f69/scales.R) is the calculation of the scale image value? Could you explain how this calculation is?

@AdeelK93
Copy link
Owner

AdeelK93 commented Apr 6, 2021

This thing is super obfuscated. In the pressreader javascript, there is this function, from where I take that calculation:

calculateMagnifierScale: function(e) {
                        var t = l.magnifierPageSizes()[e];
                        return t ? Math.floor(Math.min(100 * t.W / this.width(), 100 * t.H / this.height())) : 0
                    },

That l.magnifierPageSizes comes from an endpoint at this address that only ever returns the widths and heights 1728 and 3024.
Rather than scraping that endpoint every time, I instead hardcoded those values and this calculation. Does that help?

@Iskander1220
Copy link
Author

Do I understand correctly - on the link GetIssueInfoByCid we getting the highest values W and H? And then what principle do calculations occur?

@AdeelK93
Copy link
Owner

AdeelK93 commented Apr 9, 2021

Yeah that's the highest resolution available. What do you mean about what principle?

@Iskander1220
Copy link
Author

There was meant which computation there are produced. Is it possible to determine which values ​​are taken from link, and how are they multiplied?

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

No branches or pull requests

2 participants