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

Inconsistent output file #34

Open
oktayacikalin opened this issue Feb 19, 2025 · 4 comments
Open

Inconsistent output file #34

oktayacikalin opened this issue Feb 19, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@oktayacikalin
Copy link

oktayacikalin commented Feb 19, 2025

Hi there! πŸ‘‹

I just went through various features and what I stumbled upon is that (feelingly) every feature is writing somewhere else. For example, the "convert … -f png" is overwriting the input file. "bg" and "upscale" do not have an output parameter.

Best practice would be to always write to the same directory as the input file, appending something to the filename - do not overwrite the input file, if not explicitly requested (e.g. --in-place). While also always giving the option to specify the output parameter.

This way it would be much more predictable and much more easily integrated into scripts.

Thank you very much!

@Achno
Copy link
Owner

Achno commented Feb 19, 2025

Hello there ,

First of all, every command writes to ~/Pictures/gowall (default) and you can change the Directory you write too if you specify the option in ~/.config/gowall/config.yml check the docs.

Now as for the -oflag it's only available in the convert and gif commands and i will expand it to all commands your suggestion is correct.

As for the overwriting part, gowall does not overwrite your original image you give as input but instead creates a new image on its specified or default directory as I explained above.

Now as you noticed, the new image gets overwritten that's why I thought of creating a new option in the config.yml so instead of overwriting image.png a new image with this pattern is created

Image(1).png
image(2).png
....

@Achno Achno added the enhancement New feature or request label Feb 19, 2025
@oktayacikalin
Copy link
Author

Saving it as a copy with an incrementing number is a good idea. I would love to see that as a default.

Thanks for expanding the -o flag!

The reason I was blowing this issue up so much is because I can't stand that output directory, I think πŸ˜…. Putting those files for the upscaler into XDG_CACHE_DIR/gowall or something could work. Then write every output file to the current directory, or where specified by the user. Add the incrementing number segment to the filename if the file already exists.

I'm sorry for being too harsh. I actually really appreciate what you accomplished here.

@Achno
Copy link
Owner

Achno commented Feb 19, 2025

I'm sorry for being too harsh. I actually really appreciate what you accomplished here.

Don't worry about that it does not bother me, i'm open minded and i accept any criticism regarding any feature of gowall as long as it leads to an improvement and i get to decide whether to implement it or not , or if i want it in the project.

As long as someone does not demand for me to implement something then its cool. Remember, i created this project out of passion and i dedicate my free time however i like, this is a boundary that every open source project maintainer/author should have.

@Achno
Copy link
Owner

Achno commented Feb 19, 2025

@oktayacikalin

As of 0b1954b the use of the -o flag has been changed.

Take the scenario where your default directory is ~/Pictures/gowall

  1. using -o by only specifying a name (no extension or path) will result in a rename operation
gowall convert ~/Pictures/img.png -t rose-pine -o newName

Your image will be saved in the default directory in this case ~/Pictures/gowall/newName.png with the extension inferred

  1. using -o by specifying a path or an extension will result in a save image to that path operation
gowall convert ~/Pictures/img.png -t rose-pine -o newName.png

# or this :  gowall convert ~/Pictures/img.png -t rose-pine -o ~/New/Folder/newName.png

Here since we have an extension it will save the image newName.png in the current directory you are in, since you have not specified a path.

  • Additionally you can change format with the -o now :
gowall convert ~/Pictures/img.png -t rose-pine -o newName.webp 

Here it will save newName.webp in the current directory .


In the future the -o flag will be extended to all commands that can use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants