Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mattes authored Dec 21, 2016
2 parents 825acd4 + 84d480a commit 441e475
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/bin/epeg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ usage(const char *myname)
printf("Usage: %s [options] input.jpg thumb.jpg\n"
" -v, --verbose\n"
" -w, --width=<width>[%%] set thumbnail width [%% of input]\n"
" -h, --height=<heigth>[%%] set thumbnail heigth [%% of input]\n"
" -h, --height=<height>[%%] set thumbnail height [%% of input]\n"
" -p, --preserve preserve aspect if only one of width and height given\n"
" -m, --max=<maximum> reduce max(w,h) to maximum, with aspect preserved\n"
" -i, --inset cover at least the specified size (no upscaling or cropping)\n"
Expand Down Expand Up @@ -90,7 +90,7 @@ main(int argc, char **argv)
break;
case 'q':
thumb_quality = strtol(optarg, NULL, 10);
if (thumb_quality < 1 | thumb_quality > 100) {
if (thumb_quality < 1 || thumb_quality > 100) {
fprintf(stderr, "setting thumb_quality to default of 85\n");
thumb_quality = 85;
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/epeg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,13 +1120,12 @@ _epeg_decode_for_trim(Epeg_Image *im)
static int
_epeg_trim(Epeg_Image *im)
{
int y, a, b, w, h;
int y, a, b, h;

if ((im->in.w == im->out.w) && (im->in.h == im->out.h)) return 1;
if (im->scaled) return 1;

im->scaled = 1;
w = im->out.w;
h = im->out.h;
a = im->out.x;
b = im->out.y;
Expand Down Expand Up @@ -1248,11 +1247,12 @@ _epeg_encode(Epeg_Image *im)
exif_entry_unref(entry);
}
/* Write Exif data to output jpeg file */
unsigned char *exif_data;
unsigned char *exif_data = NULL;
unsigned int exif_data_len;
exif_data_save_data(exif, &exif_data, &exif_data_len);
jpeg_write_marker(&(im->out.jinfo), JPEG_APP0 + 1, exif_data, exif_data_len);
exif_data_unref(exif);
free(exif_data);

/* Output comment if there is one */
if (im->out.comment && *im->out.comment)
Expand Down

0 comments on commit 441e475

Please sign in to comment.