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

Fix thumbnail size during scale transition #446

Merged
merged 1 commit into from Mar 28, 2021

Conversation

kbengs
Copy link
Member

@kbengs kbengs commented Mar 27, 2021

When page format is changed the thumbnail will not have the right size
until the thumbnail is re-rendered. This commit changes resample so
that thumbnail is scaled until it is re-rendered.

@codecov-io
Copy link

codecov-io commented Mar 27, 2021

Codecov Report

Merging #446 (6e04713) into main (250cbc5) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #446      +/-   ##
==========================================
+ Coverage   71.96%   71.97%   +0.01%     
==========================================
  Files          10       10              
  Lines        2657     2658       +1     
==========================================
+ Hits         1912     1913       +1     
  Misses        745      745              
Impacted Files Coverage Δ
pdfarranger/croputils.py 90.16% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 250cbc5...6e04713. Read the comment docs.

@dreua
Copy link
Member

dreua commented Mar 27, 2021

I'm not sure I understand the issue here, can you give me the steps to reproduce? The thumbnails look fine to me after cropping or scaling.

@kbengs
Copy link
Member Author

kbengs commented Mar 28, 2021

Yep, the steps are: (in main)

  • Open a pdf where it takes several seconds to render all pages
  • Change scale factor for last page to 200%
  • Notice how the tumbnail looks like while you wait for the thumbnail to be re-rendered (it's too small)

Edit:
I changed to draft because I think it works even better if 1/page.zoom is changed to page.resample. I'll investigate.

@kbengs kbengs marked this pull request as draft March 28, 2021 03:43
When page format is changed the thumbnail will not have the right size
until the thumbnail is re-rendered. This commit changes resample so
that thumbnail is scaled until it is re-rendered.
@kbengs
Copy link
Member Author

kbengs commented Mar 28, 2021

The problem with previous code was that if you change scale factor and while you wait for re-rendering of the thumbnail, you change scale factor again. Then the thumbnail would not have the right size.
But that case is fixed now also.

@kbengs kbengs marked this pull request as ready for review March 28, 2021 06:23
@dreua
Copy link
Member

dreua commented Mar 28, 2021

Alright, I'll try to have another look today!

@jeromerobert jeromerobert merged commit b97c8d8 into pdfarranger:main Mar 28, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants