diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2ed01f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dct_dump +/jpeg-8a \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..8b096e3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,7 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +ruby '3.0.0' + +gem 'exifr' +gem 'histogram' \ No newline at end of file diff --git a/dct_dump.c b/dct_dump.c index 0af7915..92a0d6f 100644 --- a/dct_dump.c +++ b/dct_dump.c @@ -5,6 +5,7 @@ #include +#include #include #include #include @@ -44,7 +45,7 @@ void print_dct_coef( dc = buf[sf][b][j]; dc = MAX(-128, dc); dc = MIN(128, dc); - + if(opt==1) printf("%6d", dc); else @@ -52,7 +53,7 @@ void print_dct_coef( printf("%d\n", dc); } if(opt==1) - if(j%8==7) + if(j%8==7) puts(""); } @@ -69,7 +70,7 @@ GLOBAL(int) read_JPEG_file (char * filename, int opt) struct jpeg_error_mgr jerr; FILE * infile; - if ((infile = fopen(filename, "rb")) == NULL) + if ((infile = fopen(filename, "rb")) == NULL) { fprintf(stderr, "can't open %s\n", filename); return 0;