Skip to content

Commit

Permalink
small polish
Browse files Browse the repository at this point in the history
  • Loading branch information
jcupitt committed Sep 24, 2023
1 parent 9da89f8 commit eca68d5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions libvips/foreign/vips2tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
* - add support for page_height param
* 11/5/22
* - switch to terget API for output
* 24/9/23
* - add threaded write of tiled JPEG and JP2K
*/

/*
Expand Down Expand Up @@ -705,9 +707,9 @@ wtiff_compress_jpeg(Wtiff *wtiff,
VipsPel *line;

#ifdef DEBUG
printf("wtiff_compress_jpeg: left = %d, top = %d, "
"width = %d, height = %d\n",
tile->left, tile->top, tile->width, tile->height);
printf("wtiff_compress_jpeg: "
"left = %d, top = %d, width = %d, height = %d\n",
tile->left, tile->top, tile->width, tile->height);
#endif /*DEBUG*/

// we could have one of these per thread and reuse it for a small speedup
Expand All @@ -717,7 +719,7 @@ wtiff_compress_jpeg(Wtiff *wtiff,
eman.pub.output_message = vips__new_output_message;
eman.fp = NULL;

/// we need a line buffer to pad edge tiles
// we need a line buffer to pad edge tiles
line = VIPS_MALLOC(NULL, wtiff->tilew * sizeof_pel);

/* Error handling. The error message will have ben set by our handlers.
Expand All @@ -728,14 +730,14 @@ wtiff_compress_jpeg(Wtiff *wtiff,
return -1;
}

/* Attach output.
*/
vips__jpeg_target_dest(&cinfo, target);

/* Make jpeg compression object.
*/
jpeg_create_compress(&cinfo);

/* Attach output.
*/
vips__jpeg_target_dest(&cinfo, target);

wtiff_compress_jpeg_header(wtiff, &cinfo, strip->im);

// don't output tables, just coefficients
Expand Down

0 comments on commit eca68d5

Please sign in to comment.