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

Save some cropping settings to use in command line #74

Open
Hudsone opened this issue Jul 18, 2023 · 3 comments
Open

Save some cropping settings to use in command line #74

Hudsone opened this issue Jul 18, 2023 · 3 comments

Comments

@Hudsone
Copy link

Hudsone commented Jul 18, 2023

Hello, I have been using this tool to batch cropping some ebay labels. However, because of the recent changes from ebay, Briss failed to detect correct regions and my batch command can never work now.

It would be good to have a custom region setting and use it in each batching job.

The command may be something as:

briss -s some.pdf -d cropped.pdf -c config.txt

Thanks.

@Hudsone
Copy link
Author

Hudsone commented Jul 19, 2023

By the way, after some researches, I found that the original auto cropping algorithm uses standard deviations to detect the region border.

It's useful to remove noises for the scanned documents. However, it also easily gets incorrect result for well outputted documents.

I tried to implement a way to use absolute thresholds to detect the borders and it works well for my condition. Relative easy. If anyone also needs this function, maybe we can create a pull request for it. 👍

@jos-eph
Copy link

jos-eph commented Jul 27, 2023

@Hudsone I have implemented this feature to do PDF crops via the command line in a fork, https://github.com/jos-eph/Briss-2.0-command-line-crop . My first attempt at open source contribution. The readme isn't updated, but you can see the operation from the source. A command like

java -jar ./build/libs/briss-command-crop.jar -s /Users/me/Downloads/cropthis.pdf -d $HOME/Desktop/testcrop.pdf --odd-rects 147.0,154.0,460.0,643.0 --even-rects 148.0,301.0,458.0,643.0 . You can also use the --rects option if the cropping for odds and evens is identical. If you want to leave some pages out, use the --exclude-pages option with a comma-separated list of page numbers (e.g., 4,5,10). Ranges are currently not supported for the CLI.

If you run a Crop or a Preview from the GUI, it will output the command-line options that you can use to replicate the crop to the console.

Note that Briss supports cropping multiple regions on a single page, but the feature I wrote simplifies this down to one big region per page. There's also no option for rects for the exclude-pages.

cc: @cleydyr , @mbaeuerle

@Hudsone
Copy link
Author

Hudsone commented Jul 28, 2023

Oops, cool. It would be quite useful! I think a single region should be enough for most cases lol.

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

3 participants