1 From 4a0584f7c05641143151ebdc1be1163bebf9d35d Mon Sep 17 00:00:00 2001
2 From: Las <las@protonmail.ch>
3 Date: Sun, 3 Jan 2021 18:35:37 +0000
4 Subject: [PATCH] Compile transupp.c as part of the library
6 The exported symbols are made weak to not conflict with users
7 of the library that already vendor this functionality.
9 CMakeLists.txt | 4 ++--
10 transupp.c | 14 +++++++-------
11 2 files changed, 9 insertions(+), 9 deletions(-)
13 diff --git a/CMakeLists.txt b/CMakeLists.txt
14 index 0ca6f98..a9a0fae 100644
17 @@ -533,7 +533,7 @@ set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
18 jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
19 jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
20 jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
21 - jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
22 + jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c transupp.c)
24 if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
25 set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
26 @@ -1489,7 +1489,7 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
28 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
29 ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
30 - ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
31 + ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h ${CMAKE_CURRENT_SOURCE_DIR}/transupp.h
32 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
34 include(cmakescripts/BuildPackages.cmake)
35 diff --git a/transupp.c b/transupp.c
36 index 6e86077..2da49a7 100644
39 @@ -1386,7 +1386,7 @@ jt_read_integer(const char **strptr, JDIMENSION *result)
40 * This code is loosely based on XParseGeometry from the X11 distribution.
44 +GLOBAL(boolean) __attribute__((weak))
45 jtransform_parse_crop_spec(jpeg_transform_info *info, const char *spec)
48 @@ -1486,7 +1486,7 @@ trim_bottom_edge(jpeg_transform_info *info, JDIMENSION full_height)
49 * and transformation is not perfect. Otherwise returns TRUE.
53 +GLOBAL(boolean) __attribute__((weak))
54 jtransform_request_workspace(j_decompress_ptr srcinfo,
55 jpeg_transform_info *info)
57 @@ -2033,7 +2033,7 @@ adjust_exif_parameters(JOCTET *data, unsigned int length, JDIMENSION new_width,
58 * to jpeg_write_coefficients().
61 -GLOBAL(jvirt_barray_ptr *)
62 +GLOBAL(jvirt_barray_ptr *) __attribute__((weak))
63 jtransform_adjust_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
64 jvirt_barray_ptr *src_coef_arrays,
65 jpeg_transform_info *info)
66 @@ -2152,7 +2152,7 @@ jtransform_adjust_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
67 * Note that some transformations will modify the source data arrays!
71 +GLOBAL(void) __attribute__((weak))
72 jtransform_execute_transform(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
73 jvirt_barray_ptr *src_coef_arrays,
74 jpeg_transform_info *info)
75 @@ -2264,7 +2264,7 @@ jtransform_execute_transform(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
76 * (may use custom action then)
80 +GLOBAL(boolean) __attribute__((weak))
81 jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
82 int MCU_width, int MCU_height,
83 JXFORM_CODE transform)
84 @@ -2303,7 +2303,7 @@ jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
85 * This must be called before jpeg_read_header() to have the desired effect.
89 +GLOBAL(void) __attribute__((weak))
90 jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
92 #ifdef SAVE_MARKERS_SUPPORTED
93 @@ -2331,7 +2331,7 @@ jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
94 * JFIF APP0 or Adobe APP14 markers if selected.
98 +GLOBAL(void) __attribute__((weak))
99 jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,