-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upstream patch to fix build with new jpeg. Thanks to obache@ for
tracking it down. Fixes PR 41947.
- Loading branch information
dholland
committed
Aug 27, 2009
1 parent
7549e14
commit bd33d6d
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
$NetBSD: patch-ba,v 1.5 2009/08/27 09:18:06 dholland Exp $ | ||
|
||
Upstream patch to fix build with jpeg 7. | ||
|
||
--- converter/ppm/ppmtompeg/jpeg.c 2009/07/24 02:59:59 959 | ||
+++ converter/ppm/ppmtompeg/jpeg.c 2009/07/31 02:21:47 960 | ||
@@ -53,6 +53,17 @@ | ||
#define HEADER_SIZE 607 /*JFIF header size used on output images*/ | ||
|
||
|
||
+static int | ||
+minDctVScaledSize(struct jpeg_decompress_struct const cinfo) { | ||
+ | ||
+#if JPEG_LIB_VERSION >= 70 | ||
+ return cinfo.min_DCT_v_scaled_size; | ||
+#else | ||
+ return cinfo.min_DCT_scaled_size; | ||
+#endif | ||
+} | ||
+ | ||
+ | ||
|
||
/*=======================================================================* | ||
* * | ||
@@ -417,11 +428,7 @@ | ||
*/ | ||
|
||
/* set parameters for decompression */ | ||
-#ifdef JPEG4 | ||
- cinfo.want_raw_output = TRUE; | ||
-#else | ||
cinfo.raw_data_out = TRUE; | ||
-#endif | ||
cinfo.out_color_space = JCS_YCbCr; | ||
|
||
/* calculate image output dimensions */ | ||
@@ -467,11 +474,7 @@ | ||
/* Make an 8-row-high sample array that will go away when done | ||
with image | ||
*/ | ||
-#ifdef JPEG4 | ||
- buffer_height = 8; /* could be 2, 4,8 rows high */ | ||
-#else | ||
- buffer_height = cinfo.max_v_samp_factor * cinfo.min_DCT_scaled_size; | ||
-#endif | ||
+ buffer_height = cinfo.max_v_samp_factor * minDctVScaledSize(cinfo); | ||
|
||
for(cp=0,compptr = cinfo.comp_info;cp<cinfo.num_components; | ||
cp++,compptr++) { | ||
@@ -495,11 +498,7 @@ | ||
|
||
while (cinfo.output_scanline < cinfo.output_height) { | ||
|
||
-#ifdef JPEG4 | ||
- (void) jpeg_read_raw_scanlines(&cinfo, scanarray, buffer_height); | ||
-#else | ||
(void) jpeg_read_raw_data(&cinfo, scanarray, buffer_height); | ||
-#endif | ||
|
||
/* alter subsample ratio's if neccessary */ | ||
if ((h_samp[0]==2) && (h_samp[1]==1) && (h_samp[2]==1) && |