Hello community, here is the log from the commit of package libdmtx for openSUSE:Factory checked in at 2015-12-13 09:37:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdmtx (Old) and /work/SRC/openSUSE:Factory/.libdmtx.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdmtx" Changes: -------- --- /work/SRC/openSUSE:Factory/libdmtx/libdmtx.changes 2014-09-12 11:19:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libdmtx.new/libdmtx.changes 2015-12-13 09:37:33.000000000 +0100 @@ -1,0 +2,13 @@ +Mon Dec 7 20:41:43 UTC 2015 - [email protected] + +- Update RPM group and use a source URL + +------------------------------------------------------------------- +Thu Dec 3 12:40:01 UTC 2015 - [email protected] + +- Add few patches to improve funcitonality bnc#881387: + * libdmtx-DmtxPropRowPadBytes.patch + * libdmtx-explicit-cast.patch + * libdmtx-mosaic.patch + +------------------------------------------------------------------- New: ---- libdmtx-DmtxPropRowPadBytes.patch libdmtx-explicit-cast.patch libdmtx-mosaic.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdmtx.spec ++++++ --- /var/tmp/diff_new_pack.eHGmw3/_old 2015-12-13 09:37:34.000000000 +0100 +++ /var/tmp/diff_new_pack.eHGmw3/_new 2015-12-13 09:37:34.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package libdmtx # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,11 +22,16 @@ Summary: Software for reading and writing Data Matrix barcodes License: BSD-2-Clause Group: Development/Libraries/C and C++ -Url: http://www.libdmtx.org -#Source: http://sourceforge.net/projects/libdmtx/files/ -Source: %{name}-%{version}.tar.bz2 +Url: http://libdmtx.sourceforge.net/ +Source: http://downloads.sf.net/libdmtx/%{name}-%{version}.tar.bz2 Source1: baselibs.conf Patch0: libdmtx-0.7.4.diff +# PATCH-FIX-UPSTREAM libdmtx-DmtxPropRowPadBytes.patch +Patch1: libdmtx-DmtxPropRowPadBytes.patch +# PATCH-FIX-UPSTREAM libdmtx-mosaic.patch +Patch2: libdmtx-mosaic.patch +# PATCH-FIX-UPSTREAM libdmtx-explicit-cast.patch +Patch3: libdmtx-explicit-cast.patch BuildRequires: ImageMagick-devel BuildRequires: pkg-config BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -39,7 +44,7 @@ %package -n libdmtx0 Summary: Software for reading and writing Data Matrix barcodes License: GPL-2.0+ and LGPL-2.1+ -Group: Development/Libraries/C and C++ +Group: System/Libraries %description -n libdmtx0 libdmtx is open source software for reading and writing Data Matrix barcodes. @@ -58,29 +63,29 @@ its capabilities without extra restrictions or overhead. %prep -%setup -q -n %{name}-%{version} +%setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure --disable-static make %{?_smp_mflags} %install -make DESTDIR=%{buildroot} install +make DESTDIR=%{buildroot} install %{?_smp_mflags} -rm -f %{buildroot}%{_libdir}/*.la +find %{buildroot} -type f -name "*.la" -delete -print %post -n libdmtx0 -p /sbin/ldconfig %postun -n libdmtx0 -p /sbin/ldconfig -%clean -rm -rf %{buildroot} - %files -n libdmtx0 %defattr(-,root,root,-) %doc AUTHORS LICENSE ChangeLog KNOWNBUG README -%doc %{_mandir}/man?/*dmtx* +%{_mandir}/man?/*dmtx* %{_libdir}/libdmtx.so.* %files devel ++++++ libdmtx-DmtxPropRowPadBytes.patch ++++++ diff -u libdmtx-0.7.4.orig/dmtxencode.c libdmtx-0.7.4/dmtxencode.c --- libdmtx-0.7.4.orig/dmtxencode.c 2011-06-02 09:09:36.000000000 +0200 +++ libdmtx-0.7.4/dmtxencode.c 2014-06-04 08:06:47.306788067 +0200 @@ -157,7 +157,7 @@ dmtxEncodeDataMatrix(DmtxEncode *enc, int inputSize, unsigned char *inputString) { int sizeIdx; - int width, height, bitsPerPixel; + int width, height, bitsPerPixel, rowSizeBytes; unsigned char *pxl; DmtxByte outputStorage[4096]; DmtxByteList output = dmtxByteListBuild(outputStorage, sizeof(outputStorage)); @@ -202,8 +202,12 @@ return DmtxFail; assert(bitsPerPixel % 8 == 0); + rowSizeBytes = width * (bitsPerPixel/8); + /* Align to next multiple of enc->rowPadBytes */ + if(enc->rowPadBytes > 0) + rowSizeBytes = (((rowSizeBytes + enc->rowPadBytes - 1) / enc->rowPadBytes ) * enc->rowPadBytes ); /* Allocate memory for the image to be generated */ - pxl = (unsigned char *)malloc(width * height * (bitsPerPixel/8) + enc->rowPadBytes); + pxl = (unsigned char *)malloc(height * rowSizeBytes); if(pxl == NULL) { perror("pixel malloc error"); return DmtxFail; diff -u libdmtx-0.7.4.orig/dmtximage.c libdmtx-0.7.4/dmtximage.c --- libdmtx-0.7.4.orig/dmtximage.c 2011-06-02 09:09:36.000000000 +0200 +++ libdmtx-0.7.4/dmtximage.c 2014-06-04 08:04:17.289783266 +0200 @@ -76,7 +76,7 @@ img->bitsPerPixel = GetBitsPerPixel(pack); img->bytesPerPixel = img->bitsPerPixel/8; img->rowPadBytes = 0; - img->rowSizeBytes = img->width * img->bytesPerPixel + img->rowPadBytes; + img->rowSizeBytes = img->width * img->bytesPerPixel; img->imageFlip = DmtxFlipNone; /* Leave channelStart[] and bitsPerChannel[] with zeros from calloc */ @@ -192,7 +192,10 @@ switch(prop) { case DmtxPropRowPadBytes: img->rowPadBytes = value; - img->rowSizeBytes = img->width * (img->bitsPerPixel/8) + img->rowPadBytes; + img->rowSizeBytes = img->width * (img->bitsPerPixel/8); + /* Align to next multiple of img->rowPadBytes */ + if(img->rowPadBytes > 0) + img->rowSizeBytes = (((img->rowSizeBytes + img->rowPadBytes - 1) / img->rowPadBytes ) * img->rowPadBytes); break; case DmtxPropImageFlip: img->imageFlip = value; ++++++ libdmtx-explicit-cast.patch ++++++ >From a3e539a3e1c1076c7b96ad306f0883f9b363eb60 Mon Sep 17 00:00:00 2001 From: Mike Laughton <[email protected]> Date: Sun, 21 Aug 2011 22:48:33 -0500 Subject: [PATCH] Added explicit cast for strlen --- test/simple_test/simple_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/simple_test/simple_test.c b/test/simple_test/simple_test.c index 294701e..fa50968 100644 --- a/test/simple_test/simple_test.c +++ b/test/simple_test/simple_test.c @@ -34,7 +34,7 @@ main(int argc, char *argv[]) enc = dmtxEncodeCreate(); assert(enc != NULL); - dmtxEncodeDataMatrix(enc, strlen(str), str); + dmtxEncodeDataMatrix(enc, strlen((const char *)str), str); /* 2) COPY the new image data before releasing encoding memory */ ++++++ libdmtx-mosaic.patch ++++++ >From e6db5925ea0991178c7ae8c2490211bd6afab82e Mon Sep 17 00:00:00 2001 From: Mike Laughton <[email protected]> Date: Thu, 4 Aug 2011 16:35:25 -0500 Subject: [PATCH] Fixed Data Mosaic encoding bug --- TODO | 1 + dmtxencode.c | 38 +++++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) version 0.7.4: (02-Jun-2011) x library: Relicensed to use Simplified BSD with waiver option diff --git a/dmtxencode.c b/dmtxencode.c index b8fc10d..68108d0 100644 --- a/dmtxencode.c +++ b/dmtxencode.c @@ -250,7 +250,7 @@ dmtxEncodeDataMosaic(DmtxEncode *enc, int inputSize, unsigned char *inputString) int inputSizeR, inputSizeG, inputSizeB; int sizeIdxAttempt, sizeIdxFirst, sizeIdxLast; int row, col, mappingRows, mappingCols; - DmtxEncode *encG, *encB; + DmtxEncode *encR, *encG, *encB; /* Use 1/3 (ceiling) of inputSize establish input size target */ tmpInputSize = (inputSize + 2) / 3; @@ -275,30 +275,38 @@ dmtxEncodeDataMosaic(DmtxEncode *enc, int inputSize, unsigned char *inputString) else sizeIdxLast = sizeIdxFirst; - encG = encB = NULL; + encR = encG = encB = NULL; /* Try increasing symbol sizes until 3 of them can hold all input values */ for(sizeIdxAttempt = sizeIdxFirst; sizeIdxAttempt <= sizeIdxLast; sizeIdxAttempt++) { + dmtxEncodeDestroy(&encR); dmtxEncodeDestroy(&encG); dmtxEncodeDestroy(&encB); + encR = dmtxEncodeCreate(); encG = dmtxEncodeCreate(); encB = dmtxEncodeCreate(); - /* RED LAYER - Holds master copy */ - dmtxEncodeDataMatrix(enc, inputSizeR, inputStringR); - if(enc->region.sizeIdx != sizeIdxAttempt) + /* Copy all settings from master DmtxEncode, including pointer to image + and message, which is initially null */ + *encR = *encG = *encB = *enc; + + dmtxEncodeSetProp(encR, DmtxPropSizeRequest, sizeIdxAttempt); + dmtxEncodeSetProp(encG, DmtxPropSizeRequest, sizeIdxAttempt); + dmtxEncodeSetProp(encB, DmtxPropSizeRequest, sizeIdxAttempt); + + /* RED LAYER - Holds temporary copy */ + dmtxEncodeDataMatrix(encR, inputSizeR, inputStringR); + if(encR->region.sizeIdx != sizeIdxAttempt) continue; /* GREEN LAYER - Holds temporary copy */ - *encG = *enc; dmtxEncodeDataMatrix(encG, inputSizeG, inputStringG); if(encG->region.sizeIdx != sizeIdxAttempt) continue; /* BLUE LAYER - Holds temporary copy */ - *encB = *enc; dmtxEncodeDataMatrix(encB, inputSizeB, inputStringB); if(encB->region.sizeIdx != sizeIdxAttempt) continue; @@ -307,24 +315,27 @@ dmtxEncodeDataMosaic(DmtxEncode *enc, int inputSize, unsigned char *inputString) break; } - if(encG == NULL || encB == NULL) + if(encR == NULL || encG == NULL || encB == NULL) { + dmtxEncodeDestroy(&encR); dmtxEncodeDestroy(&encG); dmtxEncodeDestroy(&encB); return DmtxFail; } - dmtxEncodeSetProp(enc, DmtxPropSizeRequest, sizeIdxAttempt); + /* Now we have the correct sizeIdxAttempt, and they all fit into the desired size */ - /* Now we have the correct lengths for splitInputSize, and they all fit into the desired size */ + /* Perform the red portion of the final encode to set internals correctly */ + dmtxEncodeSetProp(enc, DmtxPropSizeRequest, sizeIdxAttempt); + dmtxEncodeDataMatrix(enc, inputSizeR, inputStringR); + /* Zero out the array and overwrite the bits in 3 passes */ mappingRows = dmtxGetSymbolAttribute(DmtxSymAttribMappingMatrixRows, sizeIdxAttempt); mappingCols = dmtxGetSymbolAttribute(DmtxSymAttribMappingMatrixCols, sizeIdxAttempt); - memset(enc->message->array, 0x00, sizeof(unsigned char) * enc->region.mappingRows * enc->region.mappingCols); - ModulePlacementEcc200(enc->message->array, enc->message->code, sizeIdxAttempt, DmtxModuleOnRed); + ModulePlacementEcc200(enc->message->array, encR->message->code, sizeIdxAttempt, DmtxModuleOnRed); /* Reset DmtxModuleAssigned and DMX_MODULE_VISITED bits */ for(row = 0; row < mappingRows; row++) { @@ -344,7 +355,8 @@ dmtxEncodeDataMosaic(DmtxEncode *enc, int inputSize, unsigned char *inputString) ModulePlacementEcc200(enc->message->array, encB->message->code, sizeIdxAttempt, DmtxModuleOnBlue); - /* Destroy encG and encB */ + /* Destroy encR, encG, and encB */ + dmtxEncodeDestroy(&encR); dmtxEncodeDestroy(&encG); dmtxEncodeDestroy(&encB);
