Fixed #2
This commit is contained in:
parent
9e8eeb3651
commit
7f438d9e19
|
@ -1,5 +1,5 @@
|
||||||
## Caesium Command Line Tools
|
## Caesium Command Line Tools
|
||||||
##### CCLT - v0.9.1-beta (build 20160121) - Copyright © Matteo Paonessa, 2016. All Rights Reserved.
|
##### CCLT - v0.9.1-beta (build 20160223) - Copyright © Matteo Paonessa, 2016. All Rights Reserved.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -48,13 +48,10 @@ $ caesiumclt -l -R -o ~/output/ ~/Pictures
|
||||||
|
|
||||||
###### TODO
|
###### TODO
|
||||||
* Code cleaning
|
* Code cleaning
|
||||||
* Folder structure support
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
###### KNOWN ISSUES
|
###### KNOWN ISSUES
|
||||||
* Strange behaviour with network files: the output base_name is the name of the output subfolder (e.g. -o /path/to/images/compressed /path/to/images -> results in all the output images named as "compressed")
|
|
||||||
* Resizing works only for powers of two (e.g. 50%, 25%, 16%...) and for JPEGs only
|
|
||||||
* It does not work on Windows unless you port getopt to it
|
* It does not work on Windows unless you port getopt to it
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
12
src/main.c
12
src/main.c
|
@ -26,8 +26,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO Use a general fuction to support folder separators
|
|
||||||
//TODO If inputs a folder AND files, send an error
|
|
||||||
//TODO If the output is INSIDE the folder we are passing as input, ignore it or we're gonna go in a infinite loop
|
//TODO If the output is INSIDE the folder we are passing as input, ignore it or we're gonna go in a infinite loop
|
||||||
|
|
||||||
void cclt_start(cclt_compress_parameters* pars, off_t* i_t_size, off_t* o_t_size) {
|
void cclt_start(cclt_compress_parameters* pars, off_t* i_t_size, off_t* o_t_size) {
|
||||||
|
@ -52,10 +50,6 @@ void cclt_start(cclt_compress_parameters* pars, off_t* i_t_size, off_t* o_t_size
|
||||||
|
|
||||||
char* output_filename = (char*) malloc ((strlen(output_folder) + 1) * sizeof(char));
|
char* output_filename = (char*) malloc ((strlen(output_folder) + 1) * sizeof(char));
|
||||||
|
|
||||||
char* i_tmp = (char*) malloc (strlen(input_files[i]) * sizeof(char));
|
|
||||||
|
|
||||||
|
|
||||||
strcpy(i_tmp, input_files[i]);
|
|
||||||
strcpy(output_filename, output_folder);
|
strcpy(output_filename, output_folder);
|
||||||
|
|
||||||
//Append / if was not entered by user
|
//Append / if was not entered by user
|
||||||
|
@ -63,8 +57,10 @@ void cclt_start(cclt_compress_parameters* pars, off_t* i_t_size, off_t* o_t_size
|
||||||
strcat(output_filename, "/");
|
strcat(output_filename, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
output_filename = realloc(output_filename, (strlen(output_filename) + strlen(basename(i_tmp))) * sizeof(char));
|
output_filename = realloc(output_filename, (strlen(output_filename) + strlen(basename(input_files[i]))) * sizeof(char));
|
||||||
output_filename = strcat(output_filename, basename(i_tmp));
|
output_filename = strcat(output_filename, basename(input_files[i]));
|
||||||
|
|
||||||
|
printf("%s\n", input_files[i]);
|
||||||
|
|
||||||
//Get input stats
|
//Get input stats
|
||||||
status = stat(input_files[i], &st_buf);
|
status = stat(input_files[i], &st_buf);
|
||||||
|
|
Loading…
Reference in New Issue