tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.56k stars 116 forks source link

Destination path parameter does not work properly #129

Closed kunapyanov closed 1 year ago

kunapyanov commented 1 year ago

Hi! I found bug: when I set destination path via -d or --dest output doesn't saves files in directory but adds folder name as prefix. Example: jpegoptim -v -dconverted ./to-convert/file.jpg will save file as ./convertedfile.jpg and converted directory will be empty. I found where is the problem: it's jpegoptim.c:347. sizeof(dest_path) returns 8 because here dest_path is pointer, not a char array like in main

tjko commented 1 year ago

Thanks for the fix. Change merged.