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 performance in convert engine: exif orientation #778

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

winged
Copy link
Contributor

@winged winged commented Nov 21, 2024

In other calls to the ImageMagick commandline tools in the same class, the suffix "[0]" is added so it only looks at the first page if it's a multi-page document such as a PDF.

For some reason, this is missing in the _get_exif_orientation() method, and may cause very long runtimes when dealing with large documents (several hundred pages of PDF).

I had a roughly 300 page PDF (plain text only, about 2.5MB) to reproduce, and the runtime of the get_thumbnail() call went down from around 90s to roughly 600ms.

In other calls to the ImageMagick commandline tools, the suffix "[0]"
is added so it only looks at the first page if it's a multi-page document
such as a PDF.

For some reason, this is missing in the `_get_exif_orientation()` method,
and may cause very long runtimes when dealing with large documents (several hundred
pages of PDF).
@winged winged force-pushed the fix_exif_orientation_speed branch from ac4b001 to dbac583 Compare November 21, 2024 11:33
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.09%. Comparing base (0df1039) to head (dbac583).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #778      +/-   ##
==========================================
+ Coverage   74.07%   74.09%   +0.01%     
==========================================
  Files          26       26              
  Lines        1678     1679       +1     
==========================================
+ Hits         1243     1244       +1     
  Misses        435      435              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Contributor

@claudep claudep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@claudep claudep merged commit 53644ce into jazzband:master Nov 21, 2024
34 checks passed
@winged winged deleted the fix_exif_orientation_speed branch November 21, 2024 17:03
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.

2 participants