Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 698882
Collapse All | Expand All

(-)a/CMakeLists.txt (-15 / +45 lines)
Lines 138-143 if(NOT SIMAGE_QUICKTIME_SUPPORT AND NOT SIMAGE_CGIMAGE_SUPPORT) Link Here
138
endif()
138
endif()
139
option(SIMAGE_XWD_SUPPORT "Enable support for XWD images (experimental)" OFF)
139
option(SIMAGE_XWD_SUPPORT "Enable support for XWD images (experimental)" OFF)
140
140
141
if(GIF_FOUND)
142
	option(SIMAGE_GIF_SUPPORT "Enable support for GIF images" ON)
143
else()
144
	set(SIMAGE_GIF_SUPPORT OFF)
145
endif()
146
147
if(JASPER_FOUND)
148
	option(SIMAGE_JASPER_SUPPORT "Enable support for JPEG2K images" ON)
149
else()
150
	set(SIMAGE_JASPER_SUPPORT OFF)
151
endif()
152
153
if(JPEG_FOUND)
154
	option(SIMAGE_JPEG_SUPPORT "Enable support for JPEG images" ON)
155
else()
156
	set(SIMAGE_JPEG_SUPPORT OFF)
157
endif()
158
159
if(PNG_FOUND)
160
	option(SIMAGE_PNG_SUPPORT "Enable support for PNG images" ON)
161
else()
162
	set(SIMAGE_PNG_SUPPORT OFF)
163
endif()
164
165
if(TIFF_FOUND)
166
	option(SIMAGE_TIFF_SUPPORT "Enable support for TIFF images" ON)
167
else()
168
	set(SIMAGE_TIFF_SUPPORT OFF)
169
endif()
170
141
report_prepare(
171
report_prepare(
142
  SIMAGE_BUILD_SHARED_LIBS
172
  SIMAGE_BUILD_SHARED_LIBS
143
  SIMAGE_BUILD_DOCUMENTATION
173
  SIMAGE_BUILD_DOCUMENTATION
Lines 218-231 if(NOT SIMAGE_QUICKTIME_SUPPORT AND NOT SIMAGE_CGIMAGE_SUPPORT AND NOT SIMAGE_GD Link Here
218
  find_package(TIFF)
248
  find_package(TIFF)
219
249
220
  set(HAVE_ZLIB ${ZLIB_FOUND})
250
  set(HAVE_ZLIB ${ZLIB_FOUND})
221
  set(HAVE_GIFLIB ${GIF_FOUND})
251
  set(HAVE_GIFLIB ${SIMAGE_GIF_SUPPORT})
222
  set(HAVE_JPEGLIB ${JPEG_FOUND})
252
  set(HAVE_JPEGLIB ${SIMAGE_JPEG_SUPPORT})
223
  set(HAVE_PNGLIB ${PNG_FOUND})
253
  set(HAVE_PNGLIB ${SIMAGE_PNG_SUPPORT})
224
  set(HAVE_TIFFLIB ${TIFF_FOUND})
254
  set(HAVE_TIFFLIB ${SIMAGE_TIFF_SUPPORT})
225
endif()
255
endif()
226
256
227
set(HAVE_JASPER ${JASPER_FOUND})
257
set(HAVE_JASPER ${SIMAGE_JASPER_SUPPORT})
228
set(HAVE_VFW ${VFW_FOUND})
258
set(HAVE_VFW ${SIMAGE_AVIENC_SUPPORT})
229
259
230
check_include_files(guile/gh.h HAVE_GUILE_GH_H)
260
check_include_files(guile/gh.h HAVE_GUILE_GH_H)
231
check_include_files(inttypes.h HAVE_INTTYPES_H)
261
check_include_files(inttypes.h HAVE_INTTYPES_H)
Lines 430-456 if(SIMAGE_GDIPLUS_SUPPORT) Link Here
430
  target_link_libraries(simage PRIVATE ${GDIPLUS_LIBRARIES})
460
  target_link_libraries(simage PRIVATE ${GDIPLUS_LIBRARIES})
431
endif()
461
endif()
432
462
433
if(GIF_FOUND)
463
if(SIMAGE_GIF_SUPPORT)
434
  target_include_directories(simage PRIVATE ${GIF_INCLUDE_DIR})
464
  target_include_directories(simage PRIVATE ${GIF_INCLUDE_DIR})
435
  target_link_libraries(simage PRIVATE ${GIF_LIBRARIES})
465
  target_link_libraries(simage PRIVATE ${GIF_LIBRARIES})
436
endif()
466
endif()
437
467
438
if(JASPER_FOUND)
468
if(SIMAGE_JASPER_SUPPORT)
439
  target_include_directories(simage PRIVATE ${JASPER_INCLUDE_DIR})
469
  target_include_directories(simage PRIVATE ${JASPER_INCLUDE_DIR})
440
  target_link_libraries(simage PRIVATE ${JASPER_LIBRARIES})
470
  target_link_libraries(simage PRIVATE ${JASPER_LIBRARIES})
441
endif()
471
endif()
442
472
443
if(JPEG_FOUND)
473
if(SIMAGE_JPEG_SUPPORT)
444
  target_include_directories(simage PRIVATE ${JPEG_INCLUDE_DIR})
474
  target_include_directories(simage PRIVATE ${JPEG_INCLUDE_DIR})
445
  target_link_libraries(simage PRIVATE ${JPEG_LIBRARIES})
475
  target_link_libraries(simage PRIVATE ${JPEG_LIBRARIES})
446
endif()
476
endif()
447
477
448
if(OGGVORBIS_FOUND)
478
if(SIMAGE_OGGVORBIS_SUPPORT)
449
  target_include_directories(simage PRIVATE ${OGGVORBIS_INCLUDE_DIRS})
479
  target_include_directories(simage PRIVATE ${OGGVORBIS_INCLUDE_DIRS})
450
  target_link_libraries(simage PRIVATE ${OGGVORBIS_LIBRARIES})
480
  target_link_libraries(simage PRIVATE ${OGGVORBIS_LIBRARIES})
451
endif()
481
endif()
452
482
453
if(PNG_FOUND)
483
if(SIMAGE_PNG_SUPPORT)
454
  target_include_directories(simage PRIVATE ${PNG_INCLUDE_DIR})
484
  target_include_directories(simage PRIVATE ${PNG_INCLUDE_DIR})
455
  target_link_libraries(simage PRIVATE ${PNG_LIBRARIES})
485
  target_link_libraries(simage PRIVATE ${PNG_LIBRARIES})
456
endif()
486
endif()
Lines 459-480 if(SIMAGE_QIMAGE_SUPPORT) Link Here
459
  target_link_libraries(simage PRIVATE ${QT_LIBRARIES})
489
  target_link_libraries(simage PRIVATE ${QT_LIBRARIES})
460
endif()
490
endif()
461
491
462
if(QUICKTIME_FOUND)
492
if(SIMAGE_QUICKTIME_SUPPORT)
463
  target_include_directories(simage PRIVATE ${QUICKTIME_INCLUDE_DIR})
493
  target_include_directories(simage PRIVATE ${QUICKTIME_INCLUDE_DIR})
464
  target_link_libraries(simage PRIVATE ${QUICKTIME_LIBRARIES})
494
  target_link_libraries(simage PRIVATE ${QUICKTIME_LIBRARIES})
465
endif()
495
endif()
466
496
467
if(SNDFILE_FOUND)
497
if(SIMAGE_QUICKTIME_SUPPORT)
468
  target_include_directories(simage PRIVATE ${SNDFILE_INCLUDE_DIRS})
498
  target_include_directories(simage PRIVATE ${SNDFILE_INCLUDE_DIRS})
469
  target_link_libraries(simage PRIVATE ${SNDFILE_LIBRARIES})
499
  target_link_libraries(simage PRIVATE ${SNDFILE_LIBRARIES})
470
endif()
500
endif()
471
501
472
if(TIFF_FOUND)
502
if(SIMAGE_TIFF_SUPPORT)
473
  target_include_directories(simage PRIVATE ${TIFF_INCLUDE_DIR})
503
  target_include_directories(simage PRIVATE ${TIFF_INCLUDE_DIR})
474
  target_link_libraries(simage PRIVATE ${TIFF_LIBRARY})
504
  target_link_libraries(simage PRIVATE ${TIFF_LIBRARY})
475
endif()
505
endif()
476
506
477
if(VFW_FOUND)
507
if(SIMAGE_AVIENC_SUPPORT)
478
  target_link_libraries(simage PRIVATE ${VFW_LIBRARIES})
508
  target_link_libraries(simage PRIVATE ${VFW_LIBRARIES})
479
endif()
509
endif()
480
510
(-)a/config.h.cmake.in (-18 / +15 lines)
Lines 9-38 Link Here
9
/* Define if first argument of Gdiplus::Bitmap::LockBits() is a pointer */
9
/* Define if first argument of Gdiplus::Bitmap::LockBits() is a pointer */
10
#cmakedefine HAVE_GDIPLUS_LOCKBITS_RECTARG_POINTER 1
10
#cmakedefine HAVE_GDIPLUS_LOCKBITS_RECTARG_POINTER 1
11
11
12
/* define to support the giflib library */
13
#cmakedefine HAVE_GIFLIB 1
14
15
/* Define to 1 if you have the <guile/gh.h> header file. */
12
/* Define to 1 if you have the <guile/gh.h> header file. */
16
#cmakedefine HAVE_GUILE_GH_H 1
13
#cmakedefine HAVE_GUILE_GH_H 1
17
14
18
/* Define to 1 if you have the <inttypes.h> header file. */
15
/* Define to 1 if you have the <inttypes.h> header file. */
19
#cmakedefine HAVE_INTTYPES_H 1
16
#cmakedefine HAVE_INTTYPES_H 1
20
17
21
/* define to support the jasper library */
22
#cmakedefine HAVE_JASPER 1
23
24
/* define to support the jpeg library */
25
#cmakedefine HAVE_JPEGLIB 1
26
27
/* Define to 1 if you have the <libguile.h> header file. */
18
/* Define to 1 if you have the <libguile.h> header file. */
28
#cmakedefine HAVE_LIBGUILE_H 1
19
#cmakedefine HAVE_LIBGUILE_H 1
29
20
30
/* Define to 1 if you have the <memory.h> header file. */
21
/* Define to 1 if you have the <memory.h> header file. */
31
#cmakedefine HAVE_MEMORY_H 1
22
#cmakedefine HAVE_MEMORY_H 1
32
23
33
/* define for libpng support */
34
#cmakedefine HAVE_PNGLIB 1
35
36
/* Define to 1 if you have the <stdint.h> header file. */
24
/* Define to 1 if you have the <stdint.h> header file. */
37
#cmakedefine HAVE_STDINT_H 1
25
#cmakedefine HAVE_STDINT_H 1
38
26
Lines 51-65 Link Here
51
/* Define to 1 if you have the <sys/types.h> header file. */
39
/* Define to 1 if you have the <sys/types.h> header file. */
52
#cmakedefine HAVE_SYS_TYPES_H 1
40
#cmakedefine HAVE_SYS_TYPES_H 1
53
41
54
/* define to support the tiff library */
55
#cmakedefine HAVE_TIFFLIB 1
56
57
/* Define to 1 if you have the <unistd.h> header file. */
42
/* Define to 1 if you have the <unistd.h> header file. */
58
#cmakedefine HAVE_UNISTD_H 1
43
#cmakedefine HAVE_UNISTD_H 1
59
44
60
/* Define to use the Video for Windows library */
61
#cmakedefine HAVE_VFW 1
62
63
/* Define to 1 if you have the <windows.h> header file. */
45
/* Define to 1 if you have the <windows.h> header file. */
64
#cmakedefine HAVE_WINDOWS_H 1
46
#cmakedefine HAVE_WINDOWS_H 1
65
47
Lines 108-113 Link Here
108
/* define this to the simage minor version number */
90
/* define this to the simage minor version number */
109
#define SIMAGE_MINOR_VERSION @SIMAGE_MINOR_VERSION@
91
#define SIMAGE_MINOR_VERSION @SIMAGE_MINOR_VERSION@
110
92
93
/* define to support the giflib library */
94
#cmakedefine SIMAGE_GIF_SUPPORT 1
95
96
/* define to support the jasper library */
97
#cmakedefine SIMAGE_JASPER_SUPPORT 1
98
99
/* define to support the jpeg library */
100
#cmakedefine SIMAGE_JPEG_SUPPORT 1
101
102
/* define for libpng support */
103
#cmakedefine SIMAGE_PNG_SUPPORT 1
104
105
/* define to support the tiff library */
106
#cmakedefine SIMAGE_TIFF_SUPPORT 1
107
111
/* define to enable mpeg2enc support */
108
/* define to enable mpeg2enc support */
112
#cmakedefine SIMAGE_MPEG2ENC_SUPPORT 1
109
#cmakedefine SIMAGE_MPEG2ENC_SUPPORT 1
113
110
(-)a/include/simage_gif.h (-2 / +2 lines)
Lines 21-29 Link Here
21
#include <config.h>
21
#include <config.h>
22
#endif /* HAVE_CONFIG_H */
22
#endif /* HAVE_CONFIG_H */
23
23
24
#ifndef HAVE_GIFLIB
24
#ifndef SIMAGE_GIF_SUPPORT
25
#error "This file should not be used under the current configuration!"
25
#error "This file should not be used under the current configuration!"
26
#endif /* !HAVE_GIFLIB */
26
#endif /* !SIMAGE_GIF_SUPPORT */
27
27
28
#ifdef __cplusplus
28
#ifdef __cplusplus
29
extern "C" {
29
extern "C" {
(-)a/include/simage_jasper.h (-2 / +2 lines)
Lines 21-29 Link Here
21
#include <config.h>
21
#include <config.h>
22
#endif /* HAVE_CONFIG_H */
22
#endif /* HAVE_CONFIG_H */
23
23
24
#ifndef HAVE_JASPER
24
#ifndef SIMAGE_JASPER_SUPPORT
25
#error "This file should not be used under the current configuration!"
25
#error "This file should not be used under the current configuration!"
26
#endif /* !HAVE_JASPERLIB */
26
#endif /* !SIMAGE_JASPER_SUPPORT */
27
27
28
#ifdef __cplusplus
28
#ifdef __cplusplus
29
extern "C" {
29
extern "C" {
(-)a/include/simage_jpeg.h (-2 / +2 lines)
Lines 21-29 Link Here
21
#include <config.h>
21
#include <config.h>
22
#endif /* HAVE_CONFIG_H */
22
#endif /* HAVE_CONFIG_H */
23
23
24
#ifndef HAVE_JPEGLIB
24
#ifndef SIMAGE_JPEG_SUPPORT
25
#error "This file should not be used under the current configuration!"
25
#error "This file should not be used under the current configuration!"
26
#endif /* !HAVE_JPEGLIB */
26
#endif /* !SIMAGE_JPEG_SUPPORT */
27
27
28
#ifdef __cplusplus
28
#ifdef __cplusplus
29
extern "C" {
29
extern "C" {
(-)a/include/simage_png.h (-2 / +2 lines)
Lines 21-29 Link Here
21
#include <config.h>
21
#include <config.h>
22
#endif /* HAVE_CONFIG_H */
22
#endif /* HAVE_CONFIG_H */
23
23
24
#ifndef HAVE_PNGLIB
24
#ifndef SIMAGE_PNG_SUPPORT
25
#error "This file should not be used under the current configuration!"
25
#error "This file should not be used under the current configuration!"
26
#endif /* !HAVE_PNGLIB */
26
#endif /* !SIMAGE_PNG_SUPPORT */
27
27
28
#ifdef __cplusplus
28
#ifdef __cplusplus
29
extern "C" {
29
extern "C" {
(-)a/include/simage_tiff.h (-2 / +2 lines)
Lines 21-29 Link Here
21
#include <config.h>
21
#include <config.h>
22
#endif /* HAVE_CONFIG_H */
22
#endif /* HAVE_CONFIG_H */
23
23
24
#ifndef HAVE_TIFFLIB
24
#ifndef SIMAGE_TIFF_SUPPORT
25
#error "This file should not be used under the current configuration!"
25
#error "This file should not be used under the current configuration!"
26
#endif /* !HAVE_TIFFLIB */
26
#endif /* !SIMAGE_TIFF_SUPPORT */
27
27
28
#ifdef __cplusplus
28
#ifdef __cplusplus
29
extern "C" {
29
extern "C" {
(-)a/src/simage_gif.c (-2 / +2 lines)
Lines 23-29 Link Here
23
#include <config.h>
23
#include <config.h>
24
#endif /* HAVE_CONFIG_H */
24
#endif /* HAVE_CONFIG_H */
25
25
26
#ifdef HAVE_GIFLIB
26
#ifdef SIMAGE_GIF_SUPPORT
27
27
28
#include <simage_gif.h>
28
#include <simage_gif.h>
29
#include <stdlib.h>
29
#include <stdlib.h>
Lines 409-412 simage_gif_save(const char * filename, Link Here
409
  return 1;
409
  return 1;
410
}
410
}
411
411
412
#endif /* HAVE_GIFLIB */
412
#endif /* SIMAGE_GIF_SUPPORT */
(-)a/src/simage_jasper.c (-2 / +2 lines)
Lines 23-29 Link Here
23
#include <config.h>
23
#include <config.h>
24
#endif /* HAVE_CONFIG_H */
24
#endif /* HAVE_CONFIG_H */
25
25
26
#ifdef HAVE_JASPER
26
#ifdef SIMAGE_JASPER_SUPPORT
27
27
28
#include <simage_jasper.h>
28
#include <simage_jasper.h>
29
29
Lines 330-333 simage_jasper_read_line(void * opendata, int y, unsigned char * buf) Link Here
330
  return 0;
330
  return 0;
331
}
331
}
332
332
333
#endif /* HAVE_JASPER */
333
#endif /* SIMAGE_JASPER_SUPPORT */
(-)a/src/simage_jpeg.c (-20 / +20 lines)
Lines 23-29 Link Here
23
#include <config.h>
23
#include <config.h>
24
#endif /* HAVE_CONFIG_H */
24
#endif /* HAVE_CONFIG_H */
25
25
26
#ifdef HAVE_JPEGLIB
26
#ifdef SIMAGE_JPEG_SUPPORT
27
27
28
#include <stdio.h>
28
#include <stdio.h>
29
#include <setjmp.h>
29
#include <setjmp.h>
Lines 74-80 simage_jpeg_error(char * buffer, int buflen) Link Here
74
      strncpy(buffer, "JPEG saver: Error opening file", buflen);
74
      strncpy(buffer, "JPEG saver: Error opening file", buflen);
75
      break;
75
      break;
76
    case ERR_JPEGLIB_WRITE:
76
    case ERR_JPEGLIB_WRITE:
77
      strncpy(buffer, "JPEG saver: Internal libjpeg error", buflen);    
77
      strncpy(buffer, "JPEG saver: Internal libjpeg error", buflen);
78
      break;
78
      break;
79
  }
79
  }
80
  return jpegerror;
80
  return jpegerror;
Lines 89-95 struct my_error_mgr { Link Here
89
89
90
typedef struct my_error_mgr * my_error_ptr;
90
typedef struct my_error_mgr * my_error_ptr;
91
91
92
static void 
92
static void
93
my_error_exit (j_common_ptr cinfo)
93
my_error_exit (j_common_ptr cinfo)
94
{
94
{
95
  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
95
  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
Lines 105-111 my_error_exit (j_common_ptr cinfo) Link Here
105
  longjmp(myerr->setjmp_buffer, 1);
105
  longjmp(myerr->setjmp_buffer, 1);
106
}
106
}
107
107
108
int 
108
int
109
simage_jpeg_identify(const char * ptr,
109
simage_jpeg_identify(const char * ptr,
110
                     const unsigned char *header,
110
                     const unsigned char *header,
111
                     int headerlen)
111
                     int headerlen)
Lines 113-121 simage_jpeg_identify(const char * ptr, Link Here
113
  static unsigned char jpgcmp[] = {'J', 'F', 'I', 'F' };
113
  static unsigned char jpgcmp[] = {'J', 'F', 'I', 'F' };
114
  static unsigned char jpgcmp2[] = {'E', 'x', 'i', 'f' };
114
  static unsigned char jpgcmp2[] = {'E', 'x', 'i', 'f' };
115
  if (headerlen < 10) return 0;
115
  if (headerlen < 10) return 0;
116
  if (memcmp((const void*)&header[6], 
116
  if (memcmp((const void*)&header[6],
117
             (const void*)jpgcmp, 4) == 0) return 1;
117
             (const void*)jpgcmp, 4) == 0) return 1;
118
  if (memcmp((const void*)&header[6], 
118
  if (memcmp((const void*)&header[6],
119
             (const void*)jpgcmp2, 4) == 0) return 1;
119
             (const void*)jpgcmp2, 4) == 0) return 1;
120
  return 0;
120
  return 0;
121
}
121
}
Lines 215-221 simage_jpeg_load(const char *filename, Link Here
215
    format = 3;
215
    format = 3;
216
    cinfo.out_color_space = JCS_RGB;
216
    cinfo.out_color_space = JCS_RGB;
217
  }
217
  }
218
  
218
219
  (void) jpeg_start_decompress(&cinfo);
219
  (void) jpeg_start_decompress(&cinfo);
220
  /* We can ignore the return value since suspension is not possible
220
  /* We can ignore the return value since suspension is not possible
221
   * with the stdio data source.
221
   * with the stdio data source.
Lines 234-253 simage_jpeg_load(const char *filename, Link Here
234
    ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
234
    ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
235
  width = cinfo.output_width;
235
  width = cinfo.output_width;
236
  height = cinfo.output_height;
236
  height = cinfo.output_height;
237
  buffer = currPtr = (unsigned char*) 
237
  buffer = currPtr = (unsigned char*)
238
    malloc(width*height*cinfo.output_components);
238
    malloc(width*height*cinfo.output_components);
239
  
239
240
  /* Step 6: while (scan lines remain to be read) */
240
  /* Step 6: while (scan lines remain to be read) */
241
  /*           jpeg_read_scanlines(...); */
241
  /*           jpeg_read_scanlines(...); */
242
242
243
  /* Here we use the library's state variable cinfo.output_scanline as the
243
  /* Here we use the library's state variable cinfo.output_scanline as the
244
   * loop counter, so that we don't have to keep track ourselves.
244
   * loop counter, so that we don't have to keep track ourselves.
245
   */
245
   */
246
  
246
247
  /* flip image upside down */
247
  /* flip image upside down */
248
  if (buffer) {
248
  if (buffer) {
249
    currPtr = buffer + row_stride * (cinfo.output_height-1);  
249
    currPtr = buffer + row_stride * (cinfo.output_height-1);
250
    
250
251
    while (cinfo.output_scanline < cinfo.output_height) {
251
    while (cinfo.output_scanline < cinfo.output_height) {
252
      /* jpeg_read_scanlines expects an array of pointers to scanlines.
252
      /* jpeg_read_scanlines expects an array of pointers to scanlines.
253
       * Here the array is only one element long, but you could ask for
253
       * Here the array is only one element long, but you could ask for
Lines 293-299 simage_jpeg_load(const char *filename, Link Here
293
  return buffer;
293
  return buffer;
294
}
294
}
295
295
296
int 
296
int
297
simage_jpeg_save(const char * filename,
297
simage_jpeg_save(const char * filename,
298
                 const unsigned char * bytes,
298
                 const unsigned char * bytes,
299
                 int width,
299
                 int width,
Lines 321-327 simage_jpeg_save(const char * filename, Link Here
321
  int quality;
321
  int quality;
322
  unsigned char * tmpbytes;
322
  unsigned char * tmpbytes;
323
  int bytesperrow;
323
  int bytesperrow;
324
  
324
325
  quality = 90;
325
  quality = 90;
326
  tmpbytes = NULL;
326
  tmpbytes = NULL;
327
327
Lines 375-381 simage_jpeg_save(const char * filename, Link Here
375
  /*
375
  /*
376
   * alpha channel is not supported for jpeg. strip it.
376
   * alpha channel is not supported for jpeg. strip it.
377
   */
377
   */
378
  
378
379
  if (numcomponents == 4) {
379
  if (numcomponents == 4) {
380
    unsigned char * dst;
380
    unsigned char * dst;
381
    const unsigned char * src;
381
    const unsigned char * src;
Lines 383-390 simage_jpeg_save(const char * filename, Link Here
383
    dst = tmpbytes = (unsigned char *) malloc(n*3);
383
    dst = tmpbytes = (unsigned char *) malloc(n*3);
384
    src = bytes;
384
    src = bytes;
385
    for (i = 0; i < n; i++) {
385
    for (i = 0; i < n; i++) {
386
      *dst++ = *src++; 
386
      *dst++ = *src++;
387
      *dst++ = *src++; 
387
      *dst++ = *src++;
388
      *dst++ = *src++;
388
      *dst++ = *src++;
389
      src++;
389
      src++;
390
    }
390
    }
Lines 397-403 simage_jpeg_save(const char * filename, Link Here
397
    dst = tmpbytes = (unsigned char *) malloc(n*3);
397
    dst = tmpbytes = (unsigned char *) malloc(n*3);
398
    src = bytes;
398
    src = bytes;
399
    for (i = 0; i < n; i++) {
399
    for (i = 0; i < n; i++) {
400
      *dst++ = *src++; 
400
      *dst++ = *src++;
401
      src++;
401
      src++;
402
    }
402
    }
403
    numcomponents = 1;
403
    numcomponents = 1;
Lines 408-414 simage_jpeg_save(const char * filename, Link Here
408
  /* First we supply a description of the input image.
408
  /* First we supply a description of the input image.
409
   * Four fields of the cinfo struct must be filled in:
409
   * Four fields of the cinfo struct must be filled in:
410
   */
410
   */
411
   
411
412
  cinfo.image_width = width;         /* image width and height, in pixels */
412
  cinfo.image_width = width;         /* image width and height, in pixels */
413
  cinfo.image_height = height;
413
  cinfo.image_height = height;
414
  cinfo.input_components = numcomponents;  /* # of color components per pixel */
414
  cinfo.input_components = numcomponents;  /* # of color components per pixel */
Lines 468-471 simage_jpeg_save(const char * filename, Link Here
468
  return 1;
468
  return 1;
469
}
469
}
470
470
471
#endif /* HAVE_JPEGLIB */
471
#endif /* SIMAGE_JPEG_SUPPORT */
(-)a/src/simage_png.c (-2 / +2 lines)
Lines 22-28 Link Here
22
#include <config.h>
22
#include <config.h>
23
#endif /* HAVE_CONFIG_H */
23
#endif /* HAVE_CONFIG_H */
24
24
25
#ifdef HAVE_PNGLIB
25
#ifdef SIMAGE_PNG_SUPPORT
26
26
27
#include <simage_png.h>
27
#include <simage_png.h>
28
#include <stdio.h>
28
#include <stdio.h>
Lines 479-482 simage_png_save(const char *filename, Link Here
479
  return 1;
479
  return 1;
480
}
480
}
481
481
482
#endif /* HAVE_PNGLIB */
482
#endif /* SIMAGE_PNG_SUPPORT */
(-)a/src/simage_tiff.c (-2 / +2 lines)
Lines 23-29 Link Here
23
#include <config.h>
23
#include <config.h>
24
#endif /* HAVE_CONFIG_H */
24
#endif /* HAVE_CONFIG_H */
25
25
26
#ifdef HAVE_TIFFLIB
26
#ifdef SIMAGE_TIFF_SUPPORT
27
27
28
#include <simage_tiff.h>
28
#include <simage_tiff.h>
29
#include <stdio.h>
29
#include <stdio.h>
Lines 683-686 simage_tiff_read_line(void * opendata, int y, unsigned char * buf) Link Here
683
#undef CVT
683
#undef CVT
684
#undef pack
684
#undef pack
685
685
686
#endif /* HAVE_TIFFLIB */
686
#endif /* SIMAGE_TIFF_SUPPORT */

Return to bug 698882