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

Add command line option to save as same filename #131

Open
za3k opened this issue Sep 24, 2024 · 5 comments
Open

Add command line option to save as same filename #131

za3k opened this issue Sep 24, 2024 · 5 comments

Comments

@za3k
Copy link

za3k commented Sep 24, 2024

Please and thank you :)

@Ndolam
Copy link
Contributor

Ndolam commented Sep 24, 2024

Just out of curiosity, should the original file be backed up (x.jpg backed up to x.jpg.bak, for example) or are you happy making the original file disappear forever?

@za3k
Copy link
Author

za3k commented Sep 24, 2024 via email

@jepler
Copy link
Owner

jepler commented Sep 24, 2024

I'm open to finding ways to make cropgui work better in conjunction with other software, but I wouldn't want this to be the default mode.

Perhaps an "--inplace" commandline flag or "--output-filename" value (which would only be sensible with a single input file?) to change from the default behavior would be a good way to approach this feature request.

@Ndolam
Copy link
Contributor

Ndolam commented Sep 24, 2024

za3k, I realize you may already have this or something like it, but in case you don't (or others reading this don't) here is some fairly shell-agnostic code which gives you the cropped filename, should the original filename be in the variable filename:

cropped=echo "$filename" | sed 's/\(.*\)\.\(.*\)/\1-cropped.\2/'

I tested it, but not extensively on every pathological file name.
(The web editor is not playing nicely with my use of back-quotes, but I hope you can see what I wrote.)

@za3k
Copy link
Author

za3k commented Sep 25, 2024

@jepler Yes, totally agreed it should not be the default. The issue name is "command-line option to [...]". Another relevant issue: #76

@Ndolam Yep, I've written it several times. But it's very annoying to remember those coding details for each new project. I would love to just write:

for x in Photos/*.jpg; do cropgui --inplace $x; done

And some use cases (like feh, for example), don't support multiple lines--they just want a single command. So I'd have to write a wrapper script or have a local fork.

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

No branches or pull requests

3 participants