autotrace.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. diff -ud autotrace-0.31.1/autotrace-config.in autotrace-0.31.1.patched/autotrace-config.in
  2. --- autotrace-0.31.1/autotrace-config.in 2002-11-08 19:18:31.000000000 +0100
  3. +++ autotrace-0.31.1.patched/autotrace-config.in 2015-08-31 01:22:03.777617655 +0200
  4. @@ -4,6 +4,7 @@
  5. af_cflags=
  6. prefix=@prefix@
  7. exec_prefix=@exec_prefix@
  8. +libdir=`pkg-config --variable=libdir autotrace`
  9. ##
  10. @@ -205,7 +206,7 @@
  11. #dummy because this should always be selected
  12. af_cflags="$af_cflags -I@includedir@"
  13. -af_libs="-L@libdir@ -lautotrace @LIBPNG_LDFLAGS@ @MAGICK_LDFLAGS@ @LIBSWF_LDFLAGS@ @LIBPSTOEDIT_LIBS@ $af_libs"
  14. +af_libs="-L$libdir -lautotrace @LIBPNG_LDFLAGS@ @MAGICK_LDFLAGS@ @LIBSWF_LDFLAGS@ @LIBPSTOEDIT_LIBS@ $af_libs"
  15. diff -ud autotrace-0.31.1/autotrace.m4 autotrace-0.31.1.patched/autotrace.m4
  16. --- autotrace-0.31.1/autotrace.m4 2002-10-10 22:44:12.000000000 +0200
  17. +++ autotrace-0.31.1.patched/autotrace.m4 2015-08-31 01:21:28.763826869 +0200
  18. @@ -4,7 +4,7 @@
  19. dnl AM_PATH_AUTOTRACE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  20. dnl Test to see if libautotrace is installed, and define AUTOTRACE_CFLAGS, LIBS
  21. dnl
  22. -AC_DEFUN(AM_PATH_AUTOTRACE,
  23. +AC_DEFUN([AM_PATH_AUTOTRACE],
  24. [dnl
  25. dnl Get the cflags and libraries from the autotrace-config script
  26. dnl
  27. diff -ud autotrace-0.31.1/input-bmp.c autotrace-0.31.1.patched/input-bmp.c
  28. --- autotrace-0.31.1/input-bmp.c 2002-10-10 22:44:08.000000000 +0200
  29. +++ autotrace-0.31.1.patched/input-bmp.c 2015-08-31 01:21:44.767369265 +0200
  30. @@ -166,7 +166,7 @@
  31. /* 36 */
  32. Maps = 4;
  33. }
  34. - else if (Bitmap_File_Head.biSize <= 64) /* Probably OS/2 2.x */
  35. + else if (Bitmap_File_Head.biSize >= 40 && Bitmap_File_Head.biSize <= 64) /* Probably OS/2 2.x */
  36. {
  37. if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4))
  38. {
  39. diff -ud autotrace-0.31.1/input-magick.c autotrace-0.31.1.patched/input-magick.c
  40. --- autotrace-0.31.1/input-magick.c 2002-10-29 04:42:05.000000000 +0100
  41. +++ autotrace-0.31.1.patched/input-magick.c 2015-08-31 01:21:23.650426744 +0200
  42. @@ -83,7 +83,11 @@
  43. for(j=0,runcount=0,point=0;j<image->rows;j++)
  44. for(i=0;i<image->columns;i++) {
  45. +#if (MagickLibVersion < 0x0645) || (MagickLibVersion >= 0x0649)
  46. p=GetOnePixel(image,i,j);
  47. +#else
  48. + GetOnePixel(image,i,j,pixel);
  49. +#endif
  50. AT_BITMAP_BITS(bitmap)[point++]=pixel->red; /* if gray: red=green=blue */
  51. if(np==3) {
  52. AT_BITMAP_BITS(bitmap)[point++]=pixel->green;
  53. diff -ud autotrace-0.31.1/input-png.c autotrace-0.31.1.patched/input-png.c
  54. --- autotrace-0.31.1/input-png.c 2002-10-10 22:44:14.000000000 +0200
  55. +++ autotrace-0.31.1.patched/input-png.c 2015-08-31 01:21:33.000548879 +0200
  56. @@ -42,7 +42,7 @@
  57. static void handle_warning(png_structp png, const at_string message) {
  58. LOG1("PNG warning: %s", message);
  59. - at_exception_warning((at_exception_type *)png->error_ptr,
  60. + at_exception_warning((at_exception_type *)png_get_error_ptr(png),
  61. message);
  62. /* at_exception_fatal((at_exception_type *)at_png->error_ptr,
  63. "PNG warning"); */
  64. @@ -50,7 +50,7 @@
  65. static void handle_error(png_structp png, const at_string message) {
  66. LOG1("PNG error: %s", message);
  67. - at_exception_fatal((at_exception_type *)png->error_ptr,
  68. + at_exception_fatal((at_exception_type *)png_get_error_ptr(png),
  69. message);
  70. /* at_exception_fatal((at_exception_type *)at_png->error_ptr,
  71. "PNG error"); */
  72. @@ -157,8 +157,8 @@
  73. png_set_strip_16(png_ptr);
  74. png_set_packing(png_ptr);
  75. - if ((png_ptr->bit_depth < 8) ||
  76. - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
  77. + if ((png_get_bit_depth(png_ptr, info_ptr) < 8) ||
  78. + (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) ||
  79. (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
  80. png_set_expand(png_ptr);
  81. @@ -181,20 +181,10 @@
  82. PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
  83. } else
  84. png_set_strip_alpha(png_ptr);
  85. + png_set_interlace_handling(png_ptr);
  86. png_read_update_info(png_ptr, info_ptr);
  87. -
  88. - info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,
  89. - info_ptr->height * sizeof(png_bytep));
  90. -#ifdef PNG_FREE_ME_SUPPORTED
  91. - info_ptr->free_me |= PNG_FREE_ROWS;
  92. -#endif
  93. - for (row = 0; row < (int)info_ptr->height; row++)
  94. - info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
  95. - png_get_rowbytes(png_ptr, info_ptr));
  96. -
  97. - png_read_image(png_ptr, info_ptr->row_pointers);
  98. - info_ptr->valid |= PNG_INFO_IDAT;
  99. + png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
  100. png_read_end(png_ptr, info_ptr);
  101. return png_get_rows(png_ptr, info_ptr);
  102. }