[med-svn] r14806 - in trunk/packages/pvrg-jpeg/trunk/debian: . patches
Mathieu Malaterre
malat at alioth.debian.org
Tue Oct 8 14:52:51 UTC 2013
Author: malat
Date: 2013-10-08 14:52:51 +0000 (Tue, 08 Oct 2013)
New Revision: 14806
Added:
trunk/packages/pvrg-jpeg/trunk/debian/patches/jpegge.patch
Modified:
trunk/packages/pvrg-jpeg/trunk/debian/changelog
trunk/packages/pvrg-jpeg/trunk/debian/compat
trunk/packages/pvrg-jpeg/trunk/debian/control
trunk/packages/pvrg-jpeg/trunk/debian/patches/cmakelists.txt.patch
trunk/packages/pvrg-jpeg/trunk/debian/patches/implicitdecl.patch
trunk/packages/pvrg-jpeg/trunk/debian/patches/jpeg.1.patch
trunk/packages/pvrg-jpeg/trunk/debian/patches/lexer.l.patch
trunk/packages/pvrg-jpeg/trunk/debian/patches/marker_o_rdwr.patch
trunk/packages/pvrg-jpeg/trunk/debian/patches/pvrg-jpeg-etb.patch
trunk/packages/pvrg-jpeg/trunk/debian/patches/series
trunk/packages/pvrg-jpeg/trunk/debian/rules
Log:
Prepare new upload
Modified: trunk/packages/pvrg-jpeg/trunk/debian/changelog
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/changelog 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/changelog 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,3 +1,11 @@
+pvrg-jpeg (1.2.1+dfsg1-3) unstable; urgency=low
+
+ * Add Stanford PVRG JPEG
+ + d/p/jpegge.patch
+ * Simplify d/rules using dh/9
+
+ -- Mathieu Malaterre <malat at debian.org> Tue, 08 Oct 2013 16:52:39 +0200
+
pvrg-jpeg (1.2.1+dfsg1-2) unstable; urgency=low
* Switch to dpkg-source 3.0 (quilt) format
Modified: trunk/packages/pvrg-jpeg/trunk/debian/compat
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/compat 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/compat 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1 +1 @@
-7
+9
Modified: trunk/packages/pvrg-jpeg/trunk/debian/control
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/control 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/control 2013-10-08 14:52:51 UTC (rev 14806)
@@ -3,8 +3,8 @@
Priority: optional
Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
Uploaders: Mathieu Malaterre <malat at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), cmake, flex
-Standards-Version: 3.9.3
+Build-Depends: debhelper (>= 9), cmake, flex
+Standards-Version: 3.9.4
Vcs-Browser: http://anonscm.debian.org/viewvc/debian-med/trunk/packages/pvrg-jpeg/trunk/
Vcs-Svn: svn://svn.debian.org/debian-med/trunk/packages/pvrg-jpeg/trunk/
Homepage: http://jpeg.sourceforge.net/
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/cmakelists.txt.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/cmakelists.txt.patch 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/cmakelists.txt.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,8 +1,10 @@
The main author prefer cmake type build system, original build system
was replaced by a cmake based one
---- pvrg.orig/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
-+++ pvrg-1.2.1/CMakeLists.txt 2008-12-22 14:05:09.000000000 +0100
+Index: pvrg-jpeg-1.2.1+dfsg1/CMakeLists.txt
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ pvrg-jpeg-1.2.1+dfsg1/CMakeLists.txt 2013-10-08 16:36:22.000000000 +0200
@@ -0,0 +1,147 @@
+# Main CMakeLists.txt to build the PVRG project using CMake (www.cmake.org)
+# Written by Mathieu Malaterre
@@ -151,4 +153,3 @@
+# lex lexer.l
+# mv lex.yy.c lexer.c
+#
-
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/implicitdecl.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/implicitdecl.patch 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/implicitdecl.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,9 +1,9 @@
Index: pvrg-jpeg-1.2.1+dfsg1/io.c
===================================================================
---- pvrg-jpeg-1.2.1+dfsg1.orig/io.c 2012-04-10 16:27:00.813893813 +0000
-+++ pvrg-jpeg-1.2.1+dfsg1/io.c 2012-04-10 16:59:24.761453020 +0000
-@@ -38,6 +38,8 @@
- #endif
+--- pvrg-jpeg-1.2.1+dfsg1.orig/io.c 2013-10-08 16:36:24.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/io.c 2013-10-08 16:36:26.000000000 +0200
+@@ -39,6 +39,8 @@
+ #include <sys/stat.h>
#include <errno.h>
+#include <stdlib.h>
@@ -11,7 +11,7 @@
/* Functions which are local and which are exported. */
-@@ -266,13 +268,13 @@
+@@ -267,13 +269,13 @@
if (Iob)
{
@@ -28,7 +28,7 @@
}
else
{
-@@ -636,8 +638,8 @@
+@@ -640,8 +642,8 @@
if (Loud > MUTE)
{
WHEREAMI();
@@ -39,7 +39,7 @@
}
horizontal = Iob->hpos * BlockWidth; /* Calculate actual */
vertical = Iob->vpos * BlockHeight; /* Pixel position */
-@@ -729,7 +731,7 @@
+@@ -733,7 +735,7 @@
int i;
if (Loud > MUTE)
@@ -48,7 +48,7 @@
switch(Iob->type)
{
case IOB_BLOCK:
-@@ -1123,8 +1125,8 @@
+@@ -1132,8 +1134,8 @@
if (Loud > MUTE)
{
WHEREAMI();
@@ -59,7 +59,7 @@
}
horizontal = Iob->hpos;
vertical = Iob->vpos;
-@@ -1189,7 +1191,7 @@
+@@ -1198,7 +1200,7 @@
rsize = read(Iob->file, timage, tsize);
if(rsize != tsize) {
WHEREAMI();
@@ -70,9 +70,9 @@
}
Index: pvrg-jpeg-1.2.1+dfsg1/jpeg.c
===================================================================
---- pvrg-jpeg-1.2.1+dfsg1.orig/jpeg.c 2012-04-10 16:27:00.817918838 +0000
-+++ pvrg-jpeg-1.2.1+dfsg1/jpeg.c 2012-04-10 17:00:44.497453182 +0000
-@@ -33,6 +33,8 @@
+--- pvrg-jpeg-1.2.1+dfsg1.orig/jpeg.c 2013-10-08 16:36:24.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/jpeg.c 2013-10-08 16:36:26.000000000 +0200
+@@ -36,6 +36,8 @@
#ifdef SYSV
#include <sys/fcntl.h>
#endif
@@ -81,7 +81,7 @@
/*
Define the functions to be used with ANSI prototyping.
-@@ -99,7 +101,7 @@
+@@ -102,7 +104,7 @@
/* Define the support/utility variables.*/
int ErrorValue=0; /* Holds error upon return */
int Loud=MUTE; /* Loudness gives level of debug traces */
@@ -90,7 +90,7 @@
int Notify=1; /* When set, gives image size feedback */
int Robust=0;
static int LargeQ=0; /* When set, large quantization is enabled */
-@@ -1730,7 +1732,7 @@
+@@ -1742,7 +1744,7 @@
BEGIN("PrintImage");
int i;
@@ -99,7 +99,7 @@
if (CImage)
{
if (CImage->StreamFileName)
-@@ -1780,14 +1782,14 @@
+@@ -1792,14 +1794,14 @@
BEGIN("PrintFrame");
int i;
@@ -116,7 +116,7 @@
printf("NumberComponents %d\n",
CFrame->GlobalNumberComponents);
for(i=0;i<CFrame->GlobalNumberComponents;i++)
-@@ -1818,7 +1820,7 @@
+@@ -1830,7 +1832,7 @@
BEGIN("PrintScan");
int i;
@@ -125,7 +125,7 @@
if (CScan)
{
printf("NumberComponents %d\n",
-@@ -1829,8 +1831,8 @@
+@@ -1841,8 +1843,8 @@
i,CScan->ci[i]);
printf("DC Huffman Table: %d AC Huffman Table: %d\n",
CScan->td[i],CScan->ta[i]);
@@ -138,8 +138,8 @@
CScan->NumberACTablesSend,
Index: pvrg-jpeg-1.2.1+dfsg1/stream.c
===================================================================
---- pvrg-jpeg-1.2.1+dfsg1.orig/stream.c 1995-03-02 01:57:26.000000000 +0000
-+++ pvrg-jpeg-1.2.1+dfsg1/stream.c 2012-04-10 16:50:54.065894139 +0000
+--- pvrg-jpeg-1.2.1+dfsg1.orig/stream.c 2013-10-08 16:36:17.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/stream.c 2013-10-08 16:36:26.000000000 +0200
@@ -32,6 +32,7 @@
#include "globals.h"
#include "marker.h"
@@ -159,8 +159,8 @@
WHEREAMI();
Index: pvrg-jpeg-1.2.1+dfsg1/transform.c
===================================================================
---- pvrg-jpeg-1.2.1+dfsg1.orig/transform.c 1995-03-02 01:57:26.000000000 +0000
-+++ pvrg-jpeg-1.2.1+dfsg1/transform.c 2012-04-10 16:48:13.729453459 +0000
+--- pvrg-jpeg-1.2.1+dfsg1.orig/transform.c 2013-10-08 16:36:17.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/transform.c 2013-10-08 16:36:26.000000000 +0200
@@ -33,6 +33,7 @@
#include "globals.h"
#include "dct.h"
@@ -171,9 +171,9 @@
Index: pvrg-jpeg-1.2.1+dfsg1/marker.c
===================================================================
---- pvrg-jpeg-1.2.1+dfsg1.orig/marker.c 2012-04-10 16:27:00.109939373 +0000
-+++ pvrg-jpeg-1.2.1+dfsg1/marker.c 2012-04-10 16:49:12.709453189 +0000
-@@ -35,6 +35,8 @@
+--- pvrg-jpeg-1.2.1+dfsg1.orig/marker.c 2013-10-08 16:36:23.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/marker.c 2013-10-08 16:36:26.000000000 +0200
+@@ -38,6 +38,8 @@
#ifdef SYSV
#include <sys/fcntl.h>
#endif
@@ -184,8 +184,8 @@
extern void WriteSoi();
Index: pvrg-jpeg-1.2.1+dfsg1/huffman.c
===================================================================
---- pvrg-jpeg-1.2.1+dfsg1.orig/huffman.c 1995-03-02 01:57:22.000000000 +0000
-+++ pvrg-jpeg-1.2.1+dfsg1/huffman.c 2012-04-10 17:00:12.537453731 +0000
+--- pvrg-jpeg-1.2.1+dfsg1.orig/huffman.c 2013-10-08 16:36:20.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/huffman.c 2013-10-08 16:36:26.000000000 +0200
@@ -33,6 +33,8 @@
#include "globals.h"
@@ -195,7 +195,7 @@
/*PUBLIC*/
-@@ -542,7 +544,7 @@
+@@ -543,7 +545,7 @@
else
{
WHEREAMI();
@@ -204,7 +204,7 @@
Resync();
ErrorValue = ERROR_HUFFMAN_READ;
return(0);
-@@ -736,7 +738,7 @@
+@@ -773,7 +775,7 @@
if (Xhuff)
{
@@ -213,7 +213,7 @@
printf("Bits: [length:number]\n");
for(i=1;i<9;i++)
{
-@@ -754,7 +756,7 @@
+@@ -791,7 +793,7 @@
}
if (Ehuff)
{
@@ -222,7 +222,7 @@
printf("Ehufco:\n");
PrintTable(Ehuff->ehufco);
printf("Ehufsi:\n");
-@@ -762,7 +764,7 @@
+@@ -799,7 +801,7 @@
}
if (Dhuff)
{
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/jpeg.1.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/jpeg.1.patch 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/jpeg.1.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,7 +1,9 @@
Replace jpeg with pvrg-jpeg. Properly escape all - with \
---- pvrg.orig/jpeg.1 2009-08-07 11:27:32.000000000 +0200
-+++ pvrg/jpeg.1 2009-08-07 11:42:54.000000000 +0200
+Index: pvrg-jpeg-1.2.1+dfsg1/jpeg.1
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/jpeg.1 2013-10-08 16:36:17.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/jpeg.1 2013-10-08 16:36:25.000000000 +0200
@@ -1,35 +1,43 @@
-.TH JPEG 1 "14 June 1993"
+.TH PVRG\-JPEG 1 "14 June 1993"
Added: trunk/packages/pvrg-jpeg/trunk/debian/patches/jpegge.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/jpegge.patch (rev 0)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/jpegge.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -0,0 +1,386 @@
+Description: Stanford PVRG JPEG Patches for GE DICOM MOD
+ As described in the medical image format FAQ, as well as the conformance
+ statement for the GE CTi, there are some problems with the JPEG lossless
+ compression on the DICOM 130mm MOD that the older models of the CTi write.
+ .
+ This patch to the Stanford PVRG JPEG code copes with these bugs, determining
+ from the compressed bit stream whether the GE bug is present or not, and if
+ present copes with it and decompresses the images as intended. Note that one
+ also needs to handle other bugs in the DICOM encapsulation, as do the recent
+ versions of dicom3tools (see for example dctoraw).
+ .
+ The patch is a composite of contributions from various other authors who have
+ suggested ways to handle the bug in both the Stanford and the Cornell code, and
+ thanks are due to them, as well as those at GE who were involved in detecting,
+ describing and correcting the bug in later CTi, MR LX and AW software versions.
+ .
+ There is also another patch (unrelated to the GE issue) to make the codec work
+ on MacOSX ... it turns out that the original code made assumptions about the
+ arguments and return values of lseek() which are not valid on some systems that
+ use a quad long (64 bits) for the offset type (off_t). The patch corrects for
+ this, as well as taking into account that the lseek() return value doesn't seem
+ to be set right on MacOSX and uses fstat() instead to determine file size wrt.
+ truncation. The most recent version also accounts for the need to not use
+ yywrap.
+Author: David Clunie <dclunie at dclunie.com>
+Origin: other, http://www.dclunie.com/jpegge.html
+Forwarded: not-needed
+Reviewed-By: Mathieu Malaterre <malat at debian.org>
+Last-Update: 2013-10-08
+
+Index: pvrg-jpeg-1.2.1+dfsg1/huffman.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/huffman.c 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/huffman.c 2013-10-08 16:36:20.000000000 +0200
+@@ -57,6 +57,7 @@
+ extern void MakeDhuff();
+ extern void UseACHuffman();
+ extern void UseDCHuffman();
++extern void UseDCHuffmanCheckingGEMSBug();
+ extern void SetACHuffman();
+ extern void SetDCHuffman();
+ extern void PrintHuffman();
+@@ -678,6 +679,42 @@
+ int index;
+ {
+ BEGIN("UseDCHuffman");
++index = 0;
++ Xhuff = CImage->DCXhuff[index];
++ Dhuff = CImage->DCDhuff[index];
++ Ehuff = CImage->DCEhuff[index];
++ if (!Dhuff && !Ehuff)
++ {
++ WHEREAMI();
++ printf("Reference to nonexistent table %d.\n",index);
++ }
++}
++
++/*BFUNC
++
++UseDCHuffmanCheckingGEMSBug() installs the DC Huffman structure from the CImage
++structure.
++
++EFUNC*/
++
++void UseDCHuffmanCheckingGEMSBug(index,detected_gems_predictor_bug)
++ int index;
++ int *detected_gems_predictor_bug;
++{
++ BEGIN("UseDCHuffmanCheckingGEMSBug");
++
++ if (index == 1
++ && !CImage->DCDhuff[index] && !CImage->DCEhuff[index]
++ && CImage->DCDhuff[0] && !CImage->DCEhuff[0])
++ {
++ index = 0;
++ *detected_gems_predictor_bug = 1;
++ printf("GE table selection bug detected - assuming predictor bug also\n",index);
++ }
++ else
++ {
++ *detected_gems_predictor_bug = 0;
++ }
+
+ Xhuff = CImage->DCXhuff[index];
+ Dhuff = CImage->DCDhuff[index];
+Index: pvrg-jpeg-1.2.1+dfsg1/makefile
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/makefile 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/makefile 2013-10-08 16:36:20.000000000 +0200
+@@ -7,16 +7,20 @@
+ # SYSV allows for SYSV system IO calls. NOTRUNCATE allows
+ # for UNIX emulators without the ftruncate() call.
+ #
++# For gcc on Solaris use DFCNTL_FOR_O_RDONLY to include <fcntl.h> not SYSV <sys/fnctl.h>`
++#
+ #DEFINES = -DSYSV -DNOTRUNCATE
+ #
+
+-DEFINES =
++#DEFINES = -DFCNTL_FOR_O_RDONLY
++CC = gcc
++LEXARGS = -ll
+ JFLAGS = -O
+ DEFS = system.h globals.h prototypes.h param.h
+ BASELINE = jpeg.o codec.o huffman.o io.o chendct.o leedct.o lexer.o marker.o stream.o transform.o
+
+ .c.o:
+- cc $(JFLAGS) $(DEFINES) -c $*.c
++ $(CC) $(JFLAGS) $(DEFINES) -c $*.c
+
+ .c.ln:
+ lint -c $*.c
+@@ -24,10 +28,10 @@
+ all: jpeg
+
+ clean:
+- rm *.o jpeg
++ rm -f *.o jpeg lexer.c
+
+ jpeg: $(BASELINE)
+- cc $(DEFINES) $(JFLAGS) $(BASELINE) -lm -o jpeg
++ $(CC) $(DEFINES) $(JFLAGS) $(BASELINE) -lm -o jpeg
+
+ jpeg.o: jpeg.c $(DEFS) tables.h
+ codec.o: codec.c $(DEFS)
+@@ -54,7 +58,12 @@
+ # Caution: Sometimes -ll is required.
+ #
+ #
+-#lexer.c: lexer.l
+-# lex lexer.l
+-# mv lex.yy.c lexer.c
+-#
++lexer.c: lexer.l
++ lex $(LEXARGS) lexer.l
++ #mv lex.yy.c lexer.c
++ echo "#ifdef FCNTL_FOR_O_RDONLY" >lexer.c
++ echo "#include <fcntl.h>" >>lexer.c
++ echo "#endif" >>lexer.c
++ cat lex.yy.c >>lexer.c
++ rm lex.yy.c
++
+Index: pvrg-jpeg-1.2.1+dfsg1/jpeg.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/jpeg.c 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/jpeg.c 2013-10-08 16:36:20.000000000 +0200
+@@ -30,6 +30,9 @@
+
+ #include "tables.h"
+ #include "globals.h"
++#ifdef FCNTL_FOR_O_RDONLY
++#include <fcntl.h>
++#endif
+ #ifdef SYSV
+ #include <sys/fcntl.h>
+ #endif
+@@ -1358,6 +1361,8 @@
+ int MaxElem,CurrentElem,NumberElem;
+ int StartofLine=1,UseType=1; /* Start with type 1 coding */
+ int *input;
++ int last_pixel; /* should initialize this sometime */
++ int detected_gems_predictor_bug;
+
+ PointTransform=CScan->SAL;
+ for(j=0;j<CScan->NumberComponents;j++) /* Important to rewind to start */
+@@ -1379,7 +1384,7 @@
+ }
+ }
+ InstallIob(0);
+- UseDCHuffman(CScan->td[0]); /* Install DC table */
++ UseDCHuffmanCheckingGEMSBug(CScan->td[0],&detected_gems_predictor_bug); /* Install DC table */
+ if (CScan->NumberComponents==1)
+ height=horfreq=1;
+ else
+@@ -1466,7 +1471,8 @@
+ px = input[width];
+ break;
+ case 2:
+- px = input[1];
++ /*px = input[1];*/
++ px = detected_gems_predictor_bug ? last_pixel : input[1];
+ break;
+ case 3:
+ px = input[0];
+@@ -1493,7 +1499,13 @@
+ else
+ {
+ value = LosslessDecodeDC();
+- input[width+1] = (value+px)&0xffff;
++ if (detected_gems_predictor_bug) {
++ input[width+1] = (px-value)&0xffff;
++ last_pixel = (px-value)&0xffff;
++ }
++ else {
++ input[width+1] = (value+px)&0xffff;
++ }
+ if (Loud > MUTE)
+ {
+ printf("OUT=%d PX=%d VAL: %d\n",
+Index: pvrg-jpeg-1.2.1+dfsg1/io.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/io.c 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/io.c 2013-10-08 16:36:20.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include <sys/fcntl.h>
+ #include <sys/unistd.h>
+ #endif
++#include <sys/stat.h>
+
+
+ /* Functions which are local and which are exported. */
+@@ -439,7 +440,8 @@
+ BUFFER *buffer;
+ {
+ BEGIN("ReadResizeBuffer");
+- int retval,diff,location,amount;
++ int retval,diff,amount;
++ off_t location;
+
+ diff = buffer->tptr - buffer->bptr; /* Find out the current usage */
+ if (len > buffer->size-1) /* calculate if we can hold it */
+@@ -490,11 +492,13 @@
+ {
+ BEGIN("FlushBuffer");
+ int retval;
++ off_t location;
+
+ #ifdef IO_DEBUG
+ printf("WriteLseek %d\n",buffer->streamoffs+buffer->currentoffs);
+ #endif
+- lseek(buffer->iob->file,buffer->streamoffs+buffer->currentoffs,L_SET);
++ location=buffer->streamoffs+buffer->currentoffs;
++ lseek(buffer->iob->file,location,L_SET);
+ if ((retval = write(buffer->iob->file,
+ buffer->space,
+ (buffer->bptr - buffer->space))) < 0)
+@@ -747,20 +751,25 @@
+ void SeekEndIob()
+ {
+ BEGIN("SeekEndIob");
+- int size,tsize;
++ off_t size,tsize;
+ static char Terminator[] = {0x80,0x00};
++ off_t location;
++ struct stat sb;
+
+- size = lseek(Iob->file,0,2);
++ location=0;
++ /*size = lseek(Iob->file,location,2);*/
++ fstat(Iob->file,&sb);
++ size=sb.st_size;
+ tsize = Iob->width*Iob->height*Iob->wsize;
+ if (size != tsize)
+ {
+ WHEREAMI();
+ printf("End not flush, making flush (actual: %d != target:%d)\n",
+- size,tsize);
++ (int)size,(int)tsize);
+
+ if (size<tsize)
+ {
+- lseek(Iob->file,tsize-1,0L); /* Seek and terminate */
++ lseek(Iob->file,tsize-1,0); /* Seek and terminate */
+ write(Iob->file,Terminator,1);
+ }
+ else if (size > tsize)
+@@ -768,7 +777,7 @@
+ #ifdef NOTRUNCATE
+ WHEREAMI();
+ printf("file is too large, only first %d bytes valid\n",
+- tsize);
++ (int)tsize);
+ #else
+ ftruncate(Iob->file,tsize); /* simply truncate*/
+ #endif
+@@ -885,7 +894,9 @@
+ void TerminateFile()
+ {
+ BEGIN("TerminateFile");
+- int i,size;
++ int i;
++ off_t size;
++ off_t location;
+ static char Terminator[] = {0x80,0x00};
+
+ if (CFrame->GlobalHeight)
+@@ -907,16 +918,14 @@
+ CFrame->vf[CScan->ci[i]]);
+ InstallIob(i);
+ FlushIob();
+- size = lseek(CScan->Iob[i]->file,0,2);
+- if (size !=
+- CFrame->Width[CScan->ci[i]]*CFrame->Height[CScan->ci[i]]*
+- CScan->Iob[i]->wsize)
++ location=0;
++ size = lseek(CScan->Iob[i]->file,location,2);
++ location=CFrame->Width[CScan->ci[i]]*CFrame->Height[CScan->ci[i]]*CScan->Iob[i]->wsize;
++ if (size != location)
+ { /* Terminate file */
+- lseek(CScan->Iob[i]->file, /* by seeking to end */
+- (CFrame->Width[CScan->ci[i]]* /* And writing byte */
+- CFrame->Height[CScan->ci[i]]*
+- CScan->Iob[i]->wsize)-1, /* Making flush with */
+- 0L); /* Original size */
++ lseek(CScan->Iob[i]->file, /* by seeking to end and writing byte */
++ location-1, /* Making flush with */
++ 0); /* Original size */
+ write(CScan->Iob[i]->file,Terminator,1);
+ }
+ }
+Index: pvrg-jpeg-1.2.1+dfsg1/SETUP
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/SETUP 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/SETUP 2013-10-08 16:36:20.000000000 +0200
+@@ -17,6 +17,11 @@
+ which allows for SYSV libraries to be used instead. The NOTRUNCATE
+ flag avoids the lack of the ftruncate() call used in io.c.
+
++For some gcc versions on Solaris, need to include <ftype.h> not
++<sys/ftype.h> otherwise O_RDONLY etc. are not defined; define
++FCNTL_FOR_O_RDONLY. This also may need to be added to the lexer.c
++output by lex to make it compile.
++
+ Caution: For the compilation, the lexer.l file should be older than
+ the lexer.c file otherwise many machines will try and lex the lexer.l
+ file (thus clobbering potentially the lexer.c file). In general, the
+@@ -25,6 +30,10 @@
+ and then remade, in which case, the lexer.c file will be older because
+ is lexically of lesser value than lexer.l. This is a potential bug.
+
++For recent MacOS versions, need to changer lexer.l to specify
++"%option noyywrap" outside the "%{ ...}%" section and remove the
++"#define yywrap() 1" definition.
++
+ 3) Testing the program.
+
+ Two small test files are nonint.jpg and blkint.jpg. If you wish to
+Index: pvrg-jpeg-1.2.1+dfsg1/prototypes.h
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/prototypes.h 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/prototypes.h 2013-10-08 16:36:20.000000000 +0200
+@@ -85,6 +85,7 @@
+ extern void MakeDhuff();
+ extern void UseACHuffman();
+ extern void UseDCHuffman();
++extern void UseDCHuffmanCheckingGEMSBug();
+ extern void SetACHuffman();
+ extern void SetDCHuffman();
+ extern void PrintHuffman();
+Index: pvrg-jpeg-1.2.1+dfsg1/lexer.l
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/lexer.l 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/lexer.l 2013-10-08 16:36:20.000000000 +0200
+@@ -15,14 +15,13 @@
+ Video Research Group (PVRG) code, and not by any author(s) (or
+ Stanford University) name.
+ *************************************************************/
+-%{
+
+-/*LABEL lexer.c */
+
+-/* Redefine the yywrap so that we don't have
+- to worry about lex library */
++%option noyywrap
+
+-# define yywrap() (1)
++%{
++
++/*LABEL lexer.c */
+
+ static char *ReservedWords[] = { /* Token names */
+ "COMPONENT",
+Index: pvrg-jpeg-1.2.1+dfsg1/marker.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/marker.c 2013-10-08 16:36:18.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/marker.c 2013-10-08 16:36:20.000000000 +0200
+@@ -32,6 +32,9 @@
+ #include "globals.h"
+ #include "stream.h"
+ #include "marker.h"
++#ifdef FCNTL_FOR_O_RDONLY
++#include <fcntl.h>
++#endif
+ #ifdef SYSV
+ #include <sys/fcntl.h>
+ #endif
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/lexer.l.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/lexer.l.patch 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/lexer.l.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,11 +1,13 @@
Need to patch lexel.l to get it to produce proper code
---- pvrg-1.2.1.orig/lexer.l 1995-03-02 02:57:15.000000000 +0100
-+++ pvrg-1.2.1/lexer.l 2008-12-15 09:49:10.000000000 +0100
-@@ -15,10 +15,27 @@
- Video Research Group (PVRG) code, and not by any author(s) (or
- Stanford University) name.
- *************************************************************/
+Index: pvrg-jpeg-1.2.1+dfsg1/lexer.l
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/lexer.l 2013-10-08 16:37:40.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/lexer.l 2013-10-08 16:39:20.000000000 +0200
+@@ -19,10 +19,27 @@
+
+ %option noyywrap
+
+%option yylineno
%{
@@ -27,10 +29,10 @@
+/* Skip declaring this function. It is a macro. */
+#define YY_SKIP_YYWRAP
+
- /* Redefine the yywrap so that we don't have
- to worry about lex library */
-
-@@ -364,12 +381,13 @@
+ static char *ReservedWords[] = { /* Token names */
+ "COMPONENT",
+ "SCAN",
+@@ -363,12 +380,13 @@
{
BEGIN("hashpjw");
char *p;
@@ -46,7 +48,7 @@
{
h = h ^(g >> 24);
h = h ^ g;
-@@ -621,7 +639,7 @@
+@@ -620,7 +638,7 @@
int Start,End;
int *ptr,*ptr2;
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/marker_o_rdwr.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/marker_o_rdwr.patch 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/marker_o_rdwr.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,10 +1,10 @@
deprecated O_WRONLY, replaced by portable O_RDWR
---- jpegdir.orig/marker.c 2005-02-03 15:06:00.000000000 -0800
-+++ jpegdir/marker.c 2005-02-03 13:44:53.000000000 -0800
-@@ -666,11 +666,11 @@
- }
- else NumberMDU = -1;
+Index: pvrg-jpeg-1.2.1+dfsg1/marker.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/marker.c 2013-10-08 16:36:20.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/marker.c 2013-10-08 16:36:23.000000000 +0200
+@@ -671,7 +671,7 @@
}
else
{
@@ -13,6 +13,3 @@
((CFrame->DataPrecision>8)?2:1));
if (CFrame->GlobalHeight)
{
- InstallIob(0);
- NumberMDU = CScan->MDUWide*CScan->MDUHigh;
-
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/pvrg-jpeg-etb.patch
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/pvrg-jpeg-etb.patch 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/pvrg-jpeg-etb.patch 2013-10-08 14:52:51 UTC (rev 14806)
@@ -4,11 +4,11 @@
This web page and the etb patch to the PVRG JPEG code is by Eli the Bearded / Benjamin Elijah Griffin.
Reproduction of code is permitted under the Creative Commons Attribution-ShareAlike License.
---- jpegdir.orig/globals.h 2005-02-03 15:06:00.000000000 -0800
-+++ jpegdir/globals.h 2005-02-03 13:25:56.000000000 -0800
-@@ -127,10 +127,12 @@
- XHUFF *ACXhuff[MAXIMUM_DEVICES]; /* Transmittable huffman tables */
- int NumberDCTables; /* Number of DC Huffman tables */
+Index: pvrg-jpeg-1.2.1+dfsg1/globals.h
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/globals.h 2013-10-08 16:36:17.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/globals.h 2013-10-08 16:36:24.000000000 +0200
+@@ -129,6 +129,8 @@
DHUFF *DCDhuff[MAXIMUM_DEVICES]; /* Decoder huffman tables */
EHUFF *DCEhuff[MAXIMUM_DEVICES]; /* Encoder huffman tables */
XHUFF *DCXhuff[MAXIMUM_DEVICES]; /* Transmittable huffman tables */
@@ -17,25 +17,19 @@
};
FRAME {
- int Type; /* SOF(X) where X is type (4 bits) */
- char *ComponentFileName[MAXIMUM_COMPONENTS]; /* image component file names */
---- jpegdir.orig/io.c 2005-02-03 15:06:00.000000000 -0800
-+++ jpegdir/io.c 2005-02-03 13:44:53.000000000 -0800
-@@ -35,10 +35,11 @@
- #ifdef SYSV
- #include <sys/fcntl.h>
- #include <sys/unistd.h>
+Index: pvrg-jpeg-1.2.1+dfsg1/io.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/io.c 2013-10-08 16:36:20.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/io.c 2013-10-08 16:36:24.000000000 +0200
+@@ -38,6 +38,7 @@
#endif
+ #include <sys/stat.h>
+#include <errno.h>
/* Functions which are local and which are exported. */
- /*PUBLIC*/
-
-@@ -61,10 +62,11 @@
- extern void SeekEndIob();
- extern void CloseIob();
+@@ -64,6 +65,7 @@
extern void MakeIob();
extern void PrintIob();
extern void InstallIob();
@@ -43,11 +37,7 @@
extern void TerminateFile();
extern void ReadLine();
- extern void ReadPreambleLine();
- extern void WriteLine();
-@@ -163,14 +165,16 @@
- int type;
- int flags;
+@@ -166,10 +168,12 @@
int wsize;
{
BEGIN("MakeIob");
@@ -61,11 +51,7 @@
for(index=0;index<CScan->NumberComponents;index++) /* Make IOBUF */
{ /* For each component */
if (!(temp = MakeStructure(IOBUF)))
- {
- WHEREAMI();
-@@ -180,10 +184,11 @@
- temp->linelastdefault=(1<<(CFrame->DataPrecision-PointTransform-1));
- temp->type = type;
+@@ -183,6 +187,7 @@
temp->wsize = wsize;
temp->hpos=0;
temp->vpos=0;
@@ -73,11 +59,7 @@
temp->width = CFrame->Width[CScan->ci[index]]; /* Set up widthxheight */
temp->height = CFrame->Height[CScan->ci[index]];
if (CScan->NumberComponents==1)
- {
- temp->hor = 1; /* For non-interleaved mode the freq */
-@@ -213,19 +218,28 @@
- {
- WHEREAMI();
+@@ -216,6 +221,10 @@
printf("Cannot allocate Iob bufferlist.\n");
exit(ERROR_MEMORY);
}
@@ -88,8 +70,7 @@
if ((temp->file = /* Open file */
open(CFrame->ComponentFileName[CScan->ci[index]],
flags,UMASK)) < 0)
- {
- WHEREAMI();
+@@ -224,7 +233,12 @@
printf("Cannot open file %s.\n",
CFrame->ComponentFileName[CScan->ci[index]]);
exit(ERROR_INIT_FILE);
@@ -103,11 +84,7 @@
for(sofs=0,current=temp->blist;current<temp->blist+temp->num;current++)
{
*current = MakeXBuffer(CFrame->BufferSize, wsize);
- (*current)->streamoffs = sofs;
- (*current)->iob = temp;
-@@ -1137,8 +1151,69 @@
- Iob->wsize; /* Reset v offset */
- vertical++;
+@@ -1148,6 +1162,67 @@
}
}
@@ -175,11 +152,11 @@
+}
/*END*/
---- jpegdir.orig/jpeg.c 2005-02-03 15:06:00.000000000 -0800
-+++ jpegdir/jpeg.c 2005-02-03 14:35:45.000000000 -0800
-@@ -212,11 +212,17 @@
- break;
- #endif
+Index: pvrg-jpeg-1.2.1+dfsg1/jpeg.c
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/jpeg.c 2013-10-08 16:36:20.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/jpeg.c 2013-10-08 16:36:24.000000000 +0200
+@@ -217,7 +217,13 @@
case 'n': /* Set non-interleaved mode */
ScanComponentThreshold=1;
break;
@@ -194,11 +171,7 @@
Oracle=1;
break;
case 'p':
- CFrame->DataPrecision = atoi(argv[++i]);
- if (!CFrame->Type) CFrame->Type = 1;
-@@ -1296,30 +1302,34 @@
- {
- if (CurrentMDU >= NumberMDU) /* If all decoded */
+@@ -1301,7 +1307,7 @@
{
if (Notify) /* Print statistics */
{
@@ -207,8 +180,7 @@
CFrame->GlobalWidth,
CFrame->GlobalHeight,
CFrame->ResyncInterval);
- }
- for(i=0;i<CScan->NumberComponents;i++) /* Print Scan info */
+@@ -1310,7 +1316,7 @@
{
if (Notify)
{
@@ -217,10 +189,7 @@
CScan->ci[i],
CFrame->ComponentFileName[CScan->ci[i]],
CFrame->Width[CScan->ci[i]],
- CFrame->Height[CScan->ci[i]],
- CFrame->hf[CScan->ci[i]],
- CFrame->vf[CScan->ci[i]]);
- }
+@@ -1321,6 +1327,10 @@
InstallIob(i);
FlushIob(); /* Close image files */
SeekEndIob();
@@ -231,11 +200,7 @@
CloseIob();
}
CurrentMDU=0;
- if (ScreenAllMarker()<0) /* See if any more images*/
- {
-@@ -1854,10 +1864,12 @@
- CImage->NumberQuantizationMatrices = 2; /* Default # matrices is 2 */
- CImage->QuantizationMatrices[0] = LuminanceQuantization;
+@@ -1868,6 +1878,8 @@
CImage->QuantizationMatrices[1] = ChrominanceQuantization;
CImage->NumberACTables = 0; /* No tables defined yet */
CImage->NumberDCTables = 0;
@@ -244,11 +209,7 @@
}
/*BFUNC
-
- MakeFrame() constructs a Frame Structure and puts it in the Current
-@@ -1979,26 +1991,41 @@
-
- void MakeConsistentFileNames()
+@@ -1993,22 +2005,37 @@
{
BEGIN("MakeConsistentFileNames");
int i;
@@ -292,11 +253,7 @@
}
}
}
-
- /*BFUNC
-@@ -2180,13 +2207,13 @@
- static void Help()
- {
+@@ -2194,9 +2221,9 @@
BEGIN("Help");
printf("jpeg -iw ImageWidth -ih ImageHeight [-JFIF] [-q(l) Q-Factor]\n");
@@ -308,11 +265,7 @@
printf(" [[-ci ComponentIndex1] [-fw FrameWidth1] [-fh FrameHeight1]\n");
printf(" [-hf HorizontalFrequency1] [-vf VerticalFrequency1]\n");
printf(" ComponentFile1]\n");
- printf(" [[-ci ComponentIndex2] [-fw FrameWidth2] [-fh FrameHeight2]\n");
- printf(" [-hf HorizontalFrequency2] [-vf VerticalFrequency2]\n");
-@@ -2194,15 +2221,17 @@
- printf(" ....\n\n");
- printf("-JFIF puts a JFIF marker. Don't change component indices.\n");
+@@ -2208,11 +2235,13 @@
printf("-a enables Reference DCT.\n");
printf("-b enables Lee DCT.\n");
printf("-d decoder enable.\n");
@@ -327,13 +280,11 @@
printf("-p specifies precision.\n");
printf("-y run in robust mode against errors (cannot be used with DNL).\n");
printf("-z uses default Huffman tables.\n");
- }
-
---- jpegdir.orig/prototypes.h 2005-02-03 15:06:00.000000000 -0800
-+++ jpegdir/prototypes.h 2005-02-03 13:44:12.000000000 -0800
-@@ -103,10 +103,11 @@
- extern void MakeIob();
- extern void PrintIob();
+Index: pvrg-jpeg-1.2.1+dfsg1/prototypes.h
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/prototypes.h 2013-10-08 16:36:20.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/prototypes.h 2013-10-08 16:36:24.000000000 +0200
+@@ -106,6 +106,7 @@
extern int NumberBlocksIob();
extern int NumberBlockMDUIob();
extern void InstallIob();
@@ -341,14 +292,11 @@
extern void TerminateFile();
extern int NumberLineMDUIob();
- extern void ReadLine();
- extern void ReadPreambleLine();
-diff -U 5 jpegdir.orig/system.h jpegdir/system.h
---- jpegdir.orig/system.h 2005-02-03 15:06:00.000000000 -0800
-+++ jpegdir/system.h 2005-02-03 13:44:12.000000000 -0800
-@@ -66,10 +66,12 @@
- int width; /* Width and height of image */
- int height;
+Index: pvrg-jpeg-1.2.1+dfsg1/system.h
+===================================================================
+--- pvrg-jpeg-1.2.1+dfsg1.orig/system.h 2013-10-08 16:36:17.000000000 +0200
++++ pvrg-jpeg-1.2.1+dfsg1/system.h 2013-10-08 16:36:24.000000000 +0200
+@@ -68,6 +68,8 @@
int file; /* File descriptor */
int flags; /* File mode flags */
int linelastdefault; /* Last line element default */
@@ -357,5 +305,3 @@
BUFFER **blist; /* A list of buffers */
};
- /* XHUFF contains all the information that needs be transmitted */
- /* EHUFF and DHUFF are derivable from XHUFF */
Modified: trunk/packages/pvrg-jpeg/trunk/debian/patches/series
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/patches/series 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/patches/series 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,3 +1,4 @@
+jpegge.patch
lexer.l.patch
cmakelists.txt.patch
marker_o_rdwr.patch
Modified: trunk/packages/pvrg-jpeg/trunk/debian/rules
===================================================================
--- trunk/packages/pvrg-jpeg/trunk/debian/rules 2013-10-07 22:23:01 UTC (rev 14805)
+++ trunk/packages/pvrg-jpeg/trunk/debian/rules 2013-10-08 14:52:51 UTC (rev 14806)
@@ -1,9 +1,7 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
-DPKG_EXPORT_BUILDFLAGS = 1
--include /usr/share/dpkg/buildflags.mk
-export LDFLAGS='-Wl,--as-needed'
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
VER_MAJOR = 1
VER_MINOR = 2
@@ -17,7 +15,7 @@
CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_SKIP_RPATH=ON \
- -DCMAKE_BUILD_TYPE:STRING=Release \
+ -DCMAKE_BUILD_TYPE:STRING="" \
-DBUILD_SHARED_LIBS=ON
%:
More information about the debian-med-commit
mailing list