"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "jpegoptim.c" between
jpegoptim-1.4.5.tar.gz and jpegoptim-1.4.6.tar.gz

About: Jpegoptim is a utility to optimize/compress JPEG/JFIF files (providing lossless optimization).

jpegoptim.c  (jpegoptim-1.4.5):jpegoptim.c  (jpegoptim-1.4.6)
/******************************************************************* /*******************************************************************
* JPEGoptim * JPEGoptim
* Copyright (c) Timo Kokkonen, 1996-2016. * Copyright (c) Timo Kokkonen, 1996-2016.
* All Rights Reserved. * All Rights Reserved.
* *
* requires libjpeg (Independent JPEG Group's JPEG software * requires libjpeg (Independent JPEG Group's JPEG software
* release 6a or later...) * release 6a or later...)
* *
* $Id: 4a81f768fff5ea2c15fe80a211b72abaeaeb3b0a $ * $Id: 74017e528ed731e76a8d244d80cf8db865aaaf76 $
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
skipping to change at line 36 skipping to change at line 36
#include <signal.h> #include <signal.h>
#include <string.h> #include <string.h>
#include <jpeglib.h> #include <jpeglib.h>
#include <jerror.h> #include <jerror.h>
#include <setjmp.h> #include <setjmp.h>
#include <time.h> #include <time.h>
#include <math.h> #include <math.h>
#include "jpegoptim.h" #include "jpegoptim.h"
#define VERSIO "1.4.5" #define VERSIO "1.4.6"
#define COPYRIGHT "Copyright (C) 1996-2018, Timo Kokkonen" #define COPYRIGHT "Copyright (C) 1996-2018, Timo Kokkonen"
#define LOG_FH (logs_to_stdout ? stdout : stderr) #define LOG_FH (logs_to_stdout ? stdout : stderr)
#define FREE_LINE_BUF(buf,lines) { \ #define FREE_LINE_BUF(buf,lines) { \
int j; \ int j; \
for (j=0;j<lines;j++) free(buf[j]); \ for (j=0;j<lines;j++) free(buf[j]); \
free(buf); \ free(buf); \
buf=NULL; \ buf=NULL; \
} }
#define STRNCPY(dest,src,n) { strncpy(dest,src,n); dest[n-1]=0; } #define STRNCPY(dest,src,n) { strncpy(dest,src,n); dest[n-1]=0; }
struct my_error_mgr { struct my_error_mgr {
struct jpeg_error_mgr pub; struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer; jmp_buf setjmp_buffer;
int jump_set; int jump_set;
}; };
typedef struct my_error_mgr * my_error_ptr; typedef struct my_error_mgr * my_error_ptr;
const char *rcsid = "$Id: 4a81f768fff5ea2c15fe80a211b72abaeaeb3b0a $"; const char *rcsid = "$Id: 74017e528ed731e76a8d244d80cf8db865aaaf76 $";
int verbose_mode = 0; int verbose_mode = 0;
int quiet_mode = 0; int quiet_mode = 0;
int global_error_counter = 0; int global_error_counter = 0;
int preserve_mode = 0; int preserve_mode = 0;
int preserve_perms = 0; int preserve_perms = 0;
int overwrite_mode = 0; int overwrite_mode = 0;
int totals_mode = 0; int totals_mode = 0;
int stdin_mode = 0; int stdin_mode = 0;
int stdout_mode = 0; int stdout_mode = 0;
skipping to change at line 195 skipping to change at line 195
" --stdout send output to standard output (instead of a file) \n" " --stdout send output to standard output (instead of a file) \n"
" --stdin read input from standard input (instead of a file) \n" " --stdin read input from standard input (instead of a file) \n"
"\n\n"); "\n\n");
} }
void print_version() void print_version()
{ {
struct jpeg_error_mgr jcerr, *err; struct jpeg_error_mgr jcerr, *err;
printf(PROGRAMNAME " v%s %s\n",VERSIO,HOST_TYPE); printf(PROGRAMNAME " v%s %s\n",VERSIO,HOST_TYPE);
printf(COPYRIGHT "\n"); printf(COPYRIGHT "\n\n");
printf("This program comes with ABSOLUTELY NO WARRANTY. This is free software,
\n"
"and you are welcome to redistirbute it under certain conditions.\n"
"See the GNU General Public License for more details.\n\n");
if (!(err=jpeg_std_error(&jcerr))) if (!(err=jpeg_std_error(&jcerr)))
fatal("jpeg_std_error() failed"); fatal("jpeg_std_error() failed");
printf("\nlibjpeg version: %s\n%s\n", printf("\nlibjpeg version: %s\n%s\n",
err->jpeg_message_table[JMSG_VERSION], err->jpeg_message_table[JMSG_VERSION],
err->jpeg_message_table[JMSG_COPYRIGHT]); err->jpeg_message_table[JMSG_COPYRIGHT]);
} }
void own_signal_handler(int a) void own_signal_handler(int a)
skipping to change at line 865 skipping to change at line 868
if (!quiet_mode || csv) fprintf(LOG_FH,csv ? "skipped\n" : "skipped.\n"); if (!quiet_mode || csv) fprintf(LOG_FH,csv ? "skipped\n" : "skipped.\n");
} }
} while (++i<argc && !stdin_mode); } while (++i<argc && !stdin_mode);
if (totals_mode && !quiet_mode) if (totals_mode && !quiet_mode)
fprintf(LOG_FH,"Average ""compression"" (%ld files): %0.2f%% (%0.0fk)\n", fprintf(LOG_FH,"Average ""compression"" (%ld files): %0.2f%% (%0.0fk)\n",
average_count, average_rate/average_count, total_save); average_count, average_rate/average_count, total_save);
jpeg_destroy_decompress(&dinfo); jpeg_destroy_decompress(&dinfo);
jpeg_destroy_compress(&cinfo); jpeg_destroy_compress(&cinfo);
free (outbuffer); free(outbuffer);
return (decompress_err_count > 0 || compress_err_count > 0 ? 1 : 0);; return (decompress_err_count > 0 || compress_err_count > 0 ? 1 : 0);;
} }
/* :-) */ /* :-) */
 End of changes. 5 change blocks. 
5 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)