Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
Maybe the hot, record breaking temperatures are slowing down my brain cells but I seem to remember that it was possible to import/export page croppings in the csv.
Am I mistaking?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,877
Threads: 290
Joined: Sep 2014
Reputation:
32
I only know of the checkbox "Automatically crop pages" in the import dialog.
Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
Yes, but that doesn't help when you have pages with more than one song, and you want to crop out each of the songs individually.
I've done this with a couple of song collection PDFs and it would be nice to share this information.
Mike, would it be feasible to add cropping info to the csv import and export? E.g. in the form widthxheight+left+top (one of the forms often used in image tools) to avoid having to specify multiple items?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 13,358
Threads: 301
Joined: Apr 2012
Reputation:
235
Sure, I can add support for that. I'll have to do some basic validation on the cropping coordinates to ensure out-of-range values were not specified (which means loading the document and checking the page sizes), but hopefully this shouldn't slow down the import very much. The automatic cropping actually has to render the page to figure out the cropping coordinates, so it will be much faster than that.
Mike
Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
Nice.
For cropping validation you do not need to render the page, you can just use the page MediaBox or CropBox.
You realize that crops go with pages? So the page range for a song that starts about halfway page 15 (pagesize 599x830) and extends to halfway page 17 would become something similar to "15@599x420+0+410,16,17@599x410+0+420".
A abbreviated form could be "15@+410,16,17@-420" (only vertical crop).
Just some ideas...
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 13,358
Threads: 301
Joined: Apr 2012
Reputation:
235
Exactly - that's what I was saying. I do not need to render the page for this new capability, so just loading the page to read the mediabox or cropbox should be plenty fast. I was comparing that to automatic cropping where I do need to render the page to analyze the pixels to figure out how much of the page can be cropped without eliminating content.
So you want to include the cropping as part of the page order? I had assumed it would be a different column, but I guess I can see that is makes sense to include it with the page order. I'll just have to write some new parsing code to replace the existing page order parsing.
Thanks,
Mike