• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto-crop limits
#1
Is there a limit to the amount of white space that can be removed with auto-crop, and is it more sensitive to side margins than to top and bottom margins?  I'm  generating songs containing PDF text files with lots of white space below the text but when I import them into MSheets, the vertical cropping only seems to remove about half of the white space at the bottom.  I'm having to manually crop my imports to get them to what I want - very inconvenient with bulk imports.  Any settings I've missed? (I tried the "aggressive crop" but there was no difference in the vertical cropping)

Background - I generate bulk PDFs using Microsoft Word.  Word saves text as text and images as image within the PDF file. Rather than tailor the PDF's individually, I make them all 37cm long, so any song will fit on one page.  As a result shorter songs have a lot of white space below but I don't want to see any of this white space when I'm viewing them in Mobile Sheets. 

[Image: view?usp=sharing]
Reply
#2
MobileSheets will stop the crop the second it hits a non-white pixel (it doesn't have to be pure white, as there is a small threshold). If you enable the aggressive cropping, then it will only stop if it hits a large block of non-white pixels. In both cases, there is a small margin applied to the cropping region to allow for a small amount of white space between the edges of the page and the content on the page. This is so that you don't have things on the very edges of the screen. I don't provide options to control this margin, but I know a request has been made previously to provide an option for that, so it's on my (very large) list of things to do.

Mike
Reply
#3
Thanks Mike.  I know all that - I'm pretty sure there's no non-white pixels where the vertical cropping is stopping because the PDF is generated from Microsoft word rather than scanned in and is structured internally mostly as PDF text.  Although there are sometimes images embedded in the document, the last line is always text, so after that it should be all white space with no non-white pixels.  In my case, I don't need to crop horizontally, as I already have the word document set to the width I require, so its just the vertical cropping I am having problems with.  Typically its cropping about half of the white space rather than all of it.  (I've got cases where there are only 4 cm of text in a 39cm liong document.)   I was wondering if there are limits to your crop scanning and it just stops doing so after scanning a particularly large area full of white pixels.


Attached Files Thumbnail(s)
   
Reply
#4
There shouldn't be any limits in regards to the size of the cropping region that is calculated. Can you send me one of those files so I can test with it on my tablet? 

Thanks,
Mike
Reply
#5
Will do
Reply
#6
(09-24-2023, 05:16 AM)runaib Wrote: ...the PDF is generated from Microsoft word rather than scanned in and is structured internally mostly as PDF text.  Although there are sometimes images embedded in the document, the last line is always text, so after that it should be all white space with no non-white pixels.

It would be good to test if the problem is still present with text only files without any images.
Sometimes text (foreground layer) can be on top of an image (background layer).

As I suggested to Mike before it would be fantastic to have control over that small margin applied to the cropping region.
On flush screens there's no problem to have no white space/margin (left/clef side of the sheet music).
Reply
#7
The algorithm is currently flawed. I have found the source of the problem and have fixed it. With the next update, the automatic cropping will now work even for very small sections of a page. Thank you runaib for providing the test files

otnt - that's definitely still on my list. It's just a very big list Smile

Mike
Reply




Users browsing this thread:
2 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.