Link Here
|
197 |
JCOPY_OPTION copyoption = JCOPYOPT_ALL; |
197 |
JCOPY_OPTION copyoption = JCOPYOPT_ALL; |
198 |
jpeg_transform_info transformoption; |
198 |
jpeg_transform_info transformoption; |
199 |
|
199 |
|
200 |
transformoption.perfect = false; |
200 |
transformoption.perfect = boolean(false); |
201 |
transformoption.force_grayscale = false; |
201 |
transformoption.force_grayscale = boolean(false); |
202 |
transformoption.trim = false; |
202 |
transformoption.trim = boolean(false); |
203 |
transformoption.crop = false; |
203 |
transformoption.crop = boolean(false); |
204 |
|
204 |
|
205 |
struct jpeg_decompress_struct srcinfo; |
205 |
struct jpeg_decompress_struct srcinfo; |
206 |
struct jpeg_compress_struct dstinfo; |
206 |
struct jpeg_compress_struct dstinfo; |
Link Here
|
277 |
kp_jpeg_qiodevice_src(&srcinfo, &input_file); |
277 |
kp_jpeg_qiodevice_src(&srcinfo, &input_file); |
278 |
jcopy_markers_setup(&srcinfo, copyoption); |
278 |
jcopy_markers_setup(&srcinfo, copyoption); |
279 |
|
279 |
|
280 |
(void) jpeg_read_header(&srcinfo, true); |
280 |
(void) jpeg_read_header(&srcinfo, boolean(true)); |
281 |
|
281 |
|
282 |
// First rotate - execute even if rotate is JXFORM_NONE to apply new EXIF settings |
282 |
// First rotate - execute even if rotate is JXFORM_NONE to apply new EXIF settings |
283 |
transformoption.transform = rotate; |
283 |
transformoption.transform = rotate; |
Link Here
|
296 |
kp_jpeg_qiodevice_dest(&dstinfo, &output_file); |
296 |
kp_jpeg_qiodevice_dest(&dstinfo, &output_file); |
297 |
|
297 |
|
298 |
// Do not write a JFIF header if previously the image did not contain it |
298 |
// Do not write a JFIF header if previously the image did not contain it |
299 |
dstinfo.write_JFIF_header = false; |
299 |
dstinfo.write_JFIF_header = boolean(false); |
300 |
|
300 |
|
301 |
// Start compressor (note no image data is actually written here) |
301 |
// Start compressor (note no image data is actually written here) |
302 |
dstinfo.optimize_coding = true; |
302 |
dstinfo.optimize_coding = boolean(true); |
303 |
jpeg_write_coefficients(&dstinfo, dst_coef_arrays); |
303 |
jpeg_write_coefficients(&dstinfo, dst_coef_arrays); |
304 |
|
304 |
|
305 |
// Copy to the output file any extra markers that we want to preserve |
305 |
// Copy to the output file any extra markers that we want to preserve |
Link Here
|
349 |
kp_jpeg_qiodevice_src(&srcinfo, &input_file); |
349 |
kp_jpeg_qiodevice_src(&srcinfo, &input_file); |
350 |
jcopy_markers_setup(&srcinfo, copyoption); |
350 |
jcopy_markers_setup(&srcinfo, copyoption); |
351 |
|
351 |
|
352 |
(void) jpeg_read_header(&srcinfo, true); |
352 |
(void) jpeg_read_header(&srcinfo, boolean(true)); |
353 |
|
353 |
|
354 |
transformoption.transform=flip; |
354 |
transformoption.transform=flip; |
355 |
jtransform_request_workspace(&srcinfo, &transformoption); |
355 |
jtransform_request_workspace(&srcinfo, &transformoption); |
Link Here
|
366 |
kp_jpeg_qiodevice_dest(&dstinfo, &output_file); |
366 |
kp_jpeg_qiodevice_dest(&dstinfo, &output_file); |
367 |
|
367 |
|
368 |
// Do not write a JFIF header if previously the image did not contain it |
368 |
// Do not write a JFIF header if previously the image did not contain it |
369 |
dstinfo.write_JFIF_header = false; |
369 |
dstinfo.write_JFIF_header = boolean(false); |
370 |
|
370 |
|
371 |
// Start compressor (note no image data is actually written here) |
371 |
// Start compressor (note no image data is actually written here) |
372 |
dstinfo.optimize_coding = true; |
372 |
dstinfo.optimize_coding = boolean(true); |
373 |
jpeg_write_coefficients(&dstinfo, dst_coef_arrays); |
373 |
jpeg_write_coefficients(&dstinfo, dst_coef_arrays); |
374 |
|
374 |
|
375 |
// Copy to the output file any extra markers that we want to preserve |
375 |
// Copy to the output file any extra markers that we want to preserve |