Lymphatus / caesium-clt

Caesium Command Line Tools - Lossy/lossless image compression tool
http://saerasoft.com/caesium
Other
354 stars 34 forks source link

caesiumclt.exe -R --overwrite deletes any non-image file #69

Closed regorxxx closed 7 months ago

regorxxx commented 7 months ago

Using caesiumclt.exe -R --overwrite all or caesiumclt.exe -R --overwrite bigger

Any non-image file, which in fact throws an error, is nuked. This is a non-desired behavior and really dangerous, specially since you allow recursion.

Either allow a mask input to filter files to process (which should default to compatible images) or just process only compatible images.

Lymphatus commented 7 months ago

It should only replace files if they are correctly processed and should already skip files that are not supported. I tried a few commands and I was unable to reproduce the issue you are mentioning. Can you provide a minimal example to reproduce? Likely the command you are executing and the folder/files structure you are compressing against. I'll fix it as soon as I'm able to reproduce it. Also which version are you using?

regorxxx commented 7 months ago
@echo off
caesiumclt.exe -R -S -q 95 --exif --overwrite bigger --output %1 %1

image Before: image After: image

In my test, the .txt files are nuked.

Lymphatus commented 7 months ago

Looking at the screenshot it seems you have an older version of the software. Which version are you using?

regorxxx commented 7 months ago

You are right, I was using 0.15.1. Seeing your changelog, it seems something was fixed with -RS args, it may be this.

I was going to compile the newest version, but seeing I have to install 10GB of VS to build... maybe some other day.

Lymphatus commented 7 months ago

I think the x86_64-pc-windows-gnu Rust target it's way smaller in size. I don't remember if it actually requires VS but you might wanna give it a try.