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

Replace original files in the PNG/JPEG compression #151

Closed
ckaiser opened this issue Jan 20, 2022 · 7 comments · Fixed by #308
Closed

Replace original files in the PNG/JPEG compression #151

ckaiser opened this issue Jan 20, 2022 · 7 comments · Fixed by #308
Labels
bug Something isn't working
Milestone

Comments

@ckaiser
Copy link

ckaiser commented Jan 20, 2022

Is your feature request related to a problem? Please describe.
It's time-consuming to save-as every file (and save all doesn't seem to do anything for me?).

Describe the solution you'd like
When optimizing images it'd be nice to be able to drag and drop a few, click on a "Replace All" button and be done, or even have a checkbox to just do that automatically as they finish, I usually end up dragging multiple to an optipng executable to accomplish the same thing, but having everything in this tool would be nice.

@veler veler added the need more info Further information is requested label Jan 20, 2022
@veler
Copy link
Collaborator

veler commented Jan 20, 2022

Hello,

Thanks for your feedback. The Save All button is supposed to prompt a Save Dialog that would allow you to select a folder where the files should be saved. Once selected, the compressed files should be moved in this target folder and replace existing files. See https://github.com/veler/DevToys/blob/0ebab4eeb28f8d94e7bc97738e1c9439ee892b67/src/dev/impl/DevToys/ViewModels/Tools/Graphic/PngJpgCompressor/PngJpgCompressorToolViewModel.cs#L226-L240

Does the Save All button does absolutely nothing for you?

@ckaiser
Copy link
Author

ckaiser commented Jan 20, 2022

Hi!

At the moment the Save All button does absolutely nothing, and the Save button for individual images opens up a save dialog box that defaults to the desktop every time, which makes it a bit tedious to navigate to things individually.

@veler
Copy link
Collaborator

veler commented Jan 21, 2022

Hi,
That is interesting. It sounds like a bug. A save dialog definitely shows up for me when clicking Save All. I will try to reproduce it and fix it.

@veler veler added bug Something isn't working and removed need more info Further information is requested labels Jan 21, 2022
@ckaiser
Copy link
Author

ckaiser commented Jan 21, 2022

Thanks! I can attempt to see if I can make it work on other files/folders later today, because I only really attempted on the one screenshot folder that I had so maybe it's something to do with that particular file path or disk drive or something related to that (spaces on the filename? or folder?)

@ckaiser
Copy link
Author

ckaiser commented Jan 30, 2022

From what I can tell from a quick run of the code under a debugger, it's giving an "Unspecified error" from inside PickSingleFolderAsync().

No error code or anything, it just fails.

A quick google led me to this StackOverflow question, and their solution actually worked! Adding folderPicker.FileTypeFilter.Add("*"); after initializing the folder picker made it stop crashing.

@veler
Copy link
Collaborator

veler commented Jan 30, 2022

Oooooh, that's interesting :O
I will have to give it a try. Also, it puzzles me that it only reproduce on some machine (at least yours and not mine). Thank you for sharing this!

@veler
Copy link
Collaborator

veler commented Jan 30, 2022

Alright, I just pushed the fix as part of this PR: #308
Thank you very much again for the help with it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants