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

Sort pages before compressing on uploads processing #587

Closed
saracarl opened this issue Mar 16, 2017 · 4 comments
Closed

Sort pages before compressing on uploads processing #587

saracarl opened this issue Mar 16, 2017 · 4 comments
Assignees

Comments

@saracarl
Copy link
Collaborator

saracarl commented Mar 16, 2017

When we process pages (say, from a PDF) to reduce their size, we don't do them in any particular order. We should sort them first so it is easier to troubleshoot.

@tbl73
Copy link
Contributor

tbl73 commented Mar 22, 2017

@saracarl What do you want them sorted by? Size? Title/Name?

@tbl73 tbl73 added in progress and removed ready labels Mar 22, 2017
@saracarl
Copy link
Collaborator Author

This is the message when the compress happens

compress tree(/tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson)
compress_tree handling /tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0007.jpg)
Found image /tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0007.jpg
"Compressed file is now 3441973 at quality 90"
"Compressed file is now 2862219 at quality 80"
"Compressed file is now 2547181 at quality 70"
"Compressed file is now 1882123 at quality 20"
"Compressed file is now 991141 at quality 10"
compressed.write('/tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0007.jpg') { self.quality = 10 }compress_tree handling /tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0002.jpg)
Found image /tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0002.jpg
"Compressed file is now 3133623 at quality 90"
"Compressed file is now 2506120 at quality 80"
"Compressed file is now 2205145 at quality 70"
"Compressed file is now 2157127 at quality 60"
"Compressed file is now 2047251 at quality 50"
"Compressed file is now 1923299 at quality 40"
"Compressed file is now 1825445 at quality 30"
"Compressed file is now 1624839 at quality 20"
"Compressed file is now 835623 at quality 10"
compressed.write('/tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0002.jpg') { self.quality = 10 }compress_tree handling /tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0001.jpg)
Found image /tmp/fromthepage_uploads/145/SCOS_b01_17661211_Case_Anderson/page_0001.jpg
etc....

@tbl73
Copy link
Contributor

tbl73 commented Mar 23, 2017

@saracarl I added a sort to the compress method which looks like it works fine. I noticed that the ingest_tree and convert_to_work methods also don't sort (because the ruby Dir.glob method doesn't sort by default) - do you want me to add a sort on those as well?

tbl73 added a commit that referenced this issue Mar 23, 2017
tbl73 added a commit that referenced this issue Mar 23, 2017
@tbl73
Copy link
Contributor

tbl73 commented Mar 23, 2017

Discussed offline, and agreed that the other steps needed a sort as well.

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

No branches or pull requests

2 participants