1 As of JPEG-9, the type 'boolean' is an enumeration, but since glib defines
2 TRUE and FALSE as numeric constants and this is C++, they need to be explicitly
5 --- a/src/af/util/xp/ut_jpeg.cpp 2009-07-08 19:33:53.000000000 +0200
6 +++ b/src/af/util/xp/ut_jpeg.cpp 2014-09-06 19:55:55.876997404 +0200
8 src->pub.next_input_byte = src->sourceBuf->getPointer (src->pos);
9 src->pub.bytes_in_buffer = src->sourceBuf->getLength ();
12 + return (boolean)TRUE;
17 /* set the data source */
18 _JPEG_ByteBufSrc (&cinfo, pBB);
20 - jpeg_read_header(&cinfo, TRUE);
21 + jpeg_read_header(&cinfo, (boolean)TRUE);
22 jpeg_start_decompress(&cinfo);
23 iImageWidth = cinfo.output_width;
24 iImageHeight = cinfo.output_height;
26 /* set the data source */
27 _JPEG_ByteBufSrc (&cinfo, pBB);
29 - jpeg_read_header(&cinfo, TRUE);
30 + jpeg_read_header(&cinfo, (boolean)TRUE);
31 jpeg_start_decompress(&cinfo);
33 int row_stride = cinfo.output_width * cinfo.output_components;
36 In the following file, we also need to reverse header include order: JPEG needs
37 to be included before Glib, which is included by "abiword-garble.h" for this fix
40 The JPEG header needs the types FILE and size_t, we can get them from cstdio.
42 --- a/plugins/garble/xp/abiword-garble-jpeg.cpp 2009-09-05 17:49:53.000000000 +0200
43 +++ b/plugins/garble/xp/abiword-garble-jpeg.cpp 2014-09-07 21:28:49.364008571 +0200
48 -#include "abiword-garble.h"
55 +#include "abiword-garble.h"
57 //-----------------------------------------------------------------------------
59 struct jpeg_destination_mgr pub;
61 mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest;
62 dest->pub.next_output_byte = dest->buf;
63 dest->pub.free_in_buffer = dest->bufsize;
65 + return (boolean)FALSE;
68 //-----------------------------------------------------------------------------
70 cinfo.image_width = (JDIMENSION) w;
71 cinfo.image_height = (JDIMENSION) h;
72 jpeg_set_defaults (&cinfo);
73 - jpeg_set_quality ( &cinfo, 50, TRUE );
74 + jpeg_set_quality ( &cinfo, 50, (boolean)TRUE );
75 cinfo.dest = (struct jpeg_destination_mgr *) (*cinfo.mem->alloc_small)((j_common_ptr)&cinfo, JPOOL_PERMANENT, sizeof(mem_destination_mgr));
76 dest = (mem_dest_ptr) cinfo.dest;
77 dest->pub.init_destination = _jpeg_init_destination;
79 dest->buf = (JOCTET*)data;
80 dest->bufsize = length;
82 - jpeg_start_compress (&cinfo, TRUE);
83 + jpeg_start_compress (&cinfo, (boolean)TRUE);
86 for (int i=0; i<h; ++i)
92 \ No newline at end of file