From 2afea4508b01adb117cf49af202f10ba9ca678b9 Mon Sep 17 00:00:00 2001 From: markd Date: Sun, 19 Jun 2016 05:04:57 +0000 Subject: Update libraw to 0.17.2 plus gcc6 fix to dcraw_common.cpp LibRaw 0.17.2 * strncpy usage was not compatible with glibc bounds check LibRaw 0.17.1 * fixed two errors found by AlphaFuzzer * phase_one_correct always returns value; handle P1 return codes in postprocessing LibRaw 0.17.0 * Fixed dcraw.c ljpeg_start possibly buffer overrun * fixed several bugs detected by using American Fuzzy Lop * C-API extension to support 3DLut Creator * More metadata parsing/extraction: XMP packet extracted (if exists) DNG Color information parsed GPS data (partially) parsed EXIF/Makernotes parsed for used optics (for both RAW files and DNG converted by Adobe convertor). * Exif/Makernotes parser callback (called for each processed tag) * Sony ARW2.3 decoder: params.sony_arw2_hack removed, decoded data are always in 0...17k range (note the difference with dcraw!) Additional processing options for Sony lossy compression techincal analysis. * Dcraw 9.26 imported (but some changes not approved because Libraw do it better) with some exceptions: no Pentax K3-II frame selection code no built-in JPEG decompressor * Many improvements in data decoding/processing: Correct decoding of black level values from metadata for many formats, LibRaw do not rely on hardcoded black levels. * 224 camera models added to supported camera list. Some of them are new (released since LibRaw 0.16 come out), some was supported before, but missed from the list. * Fujifilm F700/S20Pro second frame support --- graphics/libraw/Makefile | 4 +- graphics/libraw/distinfo | 13 ++-- graphics/libraw/patches/patch-configure | 8 +- .../patches/patch-internal_dcraw__common.cpp | 85 ++++++++++++++++++++++ 4 files changed, 98 insertions(+), 12 deletions(-) create mode 100644 graphics/libraw/patches/patch-internal_dcraw__common.cpp (limited to 'graphics/libraw') diff --git a/graphics/libraw/Makefile b/graphics/libraw/Makefile index 00a8471294b..6628eb23335 100644 --- a/graphics/libraw/Makefile +++ b/graphics/libraw/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.23 2015/07/18 10:40:20 adam Exp $ +# $NetBSD: Makefile,v 1.24 2016/06/19 05:04:57 markd Exp $ -DISTNAME= LibRaw-0.16.2 +DISTNAME= LibRaw-0.17.2 PKGNAME= ${DISTNAME:tl} CATEGORIES= graphics MASTER_SITES= http://www.libraw.org/data/ diff --git a/graphics/libraw/distinfo b/graphics/libraw/distinfo index 1b264d09bdc..eb0240a9ba8 100644 --- a/graphics/libraw/distinfo +++ b/graphics/libraw/distinfo @@ -1,10 +1,11 @@ -$NetBSD: distinfo,v 1.21 2015/11/03 21:34:09 agc Exp $ +$NetBSD: distinfo,v 1.22 2016/06/19 05:04:57 markd Exp $ -SHA1 (LibRaw-0.16.2.tar.gz) = fd74432c9167a5621d24cb5ba0d1fc082a8963b4 -RMD160 (LibRaw-0.16.2.tar.gz) = 8857b3531be0c96e4715dd7e3f4ba97e9d0f82ac -SHA512 (LibRaw-0.16.2.tar.gz) = c8fa974b72c1e2d255254527ca241a059b9a2e0943044c1b3c85257f987d451305fe94b4b901e9efd90ebab71ff602d442686a710c205d51862e88b2dfd13855 -Size (LibRaw-0.16.2.tar.gz) = 1476575 bytes -SHA1 (patch-configure) = 7626ff87dff75da3c7c136b095ee920a0045c064 +SHA1 (LibRaw-0.17.2.tar.gz) = c6721f78bd7437334c33c26354d9f2e072d240e6 +RMD160 (LibRaw-0.17.2.tar.gz) = 92f6cbbcdc64e33b154f680a8dfdfe1ab8d7302f +SHA512 (LibRaw-0.17.2.tar.gz) = e27227850b09e291802c089c826778579420a4af3f4b94dddf488bfc7eb84335d7a944445287d5993c5a574c192df5117c022d1b3d0372b3539a4553612988f4 +Size (LibRaw-0.17.2.tar.gz) = 1472714 bytes +SHA1 (patch-configure) = 79bf222e3281036e0f1aaa5a6620a971f7424809 +SHA1 (patch-internal_dcraw__common.cpp) = 624536d72f5f309a3cb19a2b249a56f3b8f2e3c2 SHA1 (patch-internal_libraw__x3f.cpp) = c141c9a86193717b829afc2795b9c4d3976fa490 SHA1 (patch-libraw__r.pc.in) = e691f79c69c5530c93262c270fe7e2f5b1c959d9 SHA1 (patch-src_libraw__cxx.cpp) = cfbb3afbd0b44ce1bbc24e5af212ad5c53d251b7 diff --git a/graphics/libraw/patches/patch-configure b/graphics/libraw/patches/patch-configure index 7e8ae941107..764427838e8 100644 --- a/graphics/libraw/patches/patch-configure +++ b/graphics/libraw/patches/patch-configure @@ -1,15 +1,15 @@ -$NetBSD: patch-configure,v 1.2 2015/07/18 10:40:20 adam Exp $ +$NetBSD: patch-configure,v 1.3 2016/06/19 05:04:57 markd Exp $ Avoid libstdc++. ---- configure.orig 2015-05-16 17:23:47.000000000 +0000 +--- configure.orig 2016-05-14 06:55:11.000000000 +0000 +++ configure -@@ -16358,7 +16358,7 @@ $as_echo "$as_me: WARNING: Unable to fin +@@ -16967,7 +16967,7 @@ $as_echo "$as_me: WARNING: Unable to fin fi fi -LIBS="$LIBS -lm -lstdc++" +LIBS="$LIBS -lm" - LIBRAW_SHLIB_VERSION=10:0:0 + LIBRAW_SHLIB_VERSION=15:0:0 diff --git a/graphics/libraw/patches/patch-internal_dcraw__common.cpp b/graphics/libraw/patches/patch-internal_dcraw__common.cpp new file mode 100644 index 00000000000..076e73092e9 --- /dev/null +++ b/graphics/libraw/patches/patch-internal_dcraw__common.cpp @@ -0,0 +1,85 @@ +$NetBSD: patch-internal_dcraw__common.cpp,v 1.1 2016/06/19 05:04:57 markd Exp $ + +gcc6 fix + +--- internal/dcraw_common.cpp.orig 2016-05-14 06:55:03.000000000 +0000 ++++ internal/dcraw_common.cpp +@@ -4513,30 +4513,37 @@ void CLASS lin_interpolate() + */ + void CLASS vng_interpolate() + { +- static const signed char *cp, terms[] = { +- -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, +- -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, +- -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, +- -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06, +- -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04, +- -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, +- -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40, +- -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11, +- -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11, +- -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22, +- -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44, +- -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10, +- -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04, +- +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40, +- +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20, +- +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08, +- +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20, +- +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44, +- +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60, +- +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80, +- +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, +- +1,+0,+2,+1,0,0x10 +- }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ++ struct interpolate_terms { ++ signed char y1, x1, y2, x2, weight; ++ unsigned char grads; ++ }; ++ static const interpolate_terms terms[] = { ++ {-2,-2,+0,-1,0,0x01}, {-2,-2,+0,+0,1,0x01}, {-2,-1,-1,+0,0,0x01}, ++ {-2,-1,+0,-1,0,0x02}, {-2,-1,+0,+0,0,0x03}, {-2,-1,+0,+1,1,0x01}, ++ {-2,+0,+0,-1,0,0x06}, {-2,+0,+0,+0,1,0x02}, {-2,+0,+0,+1,0,0x03}, ++ {-2,+1,-1,+0,0,0x04}, {-2,+1,+0,-1,1,0x04}, {-2,+1,+0,+0,0,0x06}, ++ {-2,+1,+0,+1,0,0x02}, {-2,+2,+0,+0,1,0x04}, {-2,+2,+0,+1,0,0x04}, ++ {-1,-2,-1,+0,0,0x80}, {-1,-2,+0,-1,0,0x01}, {-1,-2,+1,-1,0,0x01}, ++ {-1,-2,+1,+0,1,0x01}, {-1,-1,-1,+1,0,0x88}, {-1,-1,+1,-2,0,0x40}, ++ {-1,-1,+1,-1,0,0x22}, {-1,-1,+1,+0,0,0x33}, {-1,-1,+1,+1,1,0x11}, ++ {-1,+0,-1,+2,0,0x08}, {-1,+0,+0,-1,0,0x44}, {-1,+0,+0,+1,0,0x11}, ++ {-1,+0,+1,-2,1,0x40}, {-1,+0,+1,-1,0,0x66}, {-1,+0,+1,+0,1,0x22}, ++ {-1,+0,+1,+1,0,0x33}, {-1,+0,+1,+2,1,0x10}, {-1,+1,+1,-1,1,0x44}, ++ {-1,+1,+1,+0,0,0x66}, {-1,+1,+1,+1,0,0x22}, {-1,+1,+1,+2,0,0x10}, ++ {-1,+2,+0,+1,0,0x04}, {-1,+2,+1,+0,1,0x04}, {-1,+2,+1,+1,0,0x04}, ++ {+0,-2,+0,+0,1,0x80}, {+0,-1,+0,+1,1,0x88}, {+0,-1,+1,-2,0,0x40}, ++ {+0,-1,+1,+0,0,0x11}, {+0,-1,+2,-2,0,0x40}, {+0,-1,+2,-1,0,0x20}, ++ {+0,-1,+2,+0,0,0x30}, {+0,-1,+2,+1,1,0x10}, {+0,+0,+0,+2,1,0x08}, ++ {+0,+0,+2,-2,1,0x40}, {+0,+0,+2,-1,0,0x60}, {+0,+0,+2,+0,1,0x20}, ++ {+0,+0,+2,+1,0,0x30}, {+0,+0,+2,+2,1,0x10}, {+0,+1,+1,+0,0,0x44}, ++ {+0,+1,+1,+2,0,0x10}, {+0,+1,+2,-1,1,0x40}, {+0,+1,+2,+0,0,0x60}, ++ {+0,+1,+2,+1,0,0x20}, {+0,+1,+2,+2,0,0x10}, {+1,-2,+1,+0,0,0x80}, ++ {+1,-1,+1,+1,0,0x88}, {+1,+0,+1,+2,0,0x08}, {+1,+0,+2,-1,0,0x40}, ++ {+1,+0,+2,+1,0,0x10} ++ }; ++ const interpolate_terms *cpt; ++ signed char *cp; ++ signed char chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; + ushort (*brow[5])[4], *pix; + int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; + int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag; +@@ -4554,11 +4561,11 @@ void CLASS vng_interpolate() + for (row=0; row < prow; row++) /* Precalculate for VNG */ + for (col=0; col < pcol; col++) { + code[row][col] = ip; +- for (cp=terms, t=0; t < 64; t++) { +- y1 = *cp++; x1 = *cp++; +- y2 = *cp++; x2 = *cp++; +- weight = *cp++; +- grads = *cp++; ++ for (cpt=&terms[0], t=0; t < 64, cpt = &terms[t]; t++) { ++ y1 = cpt->y1; x1 = cpt->x1; ++ y2 = cpt->y2; x2 = cpt->x2; ++ weight = cpt->weight; ++ grads = cpt->grads; + color = fcol(row+y1,col+x1); + if (fcol(row+y2,col+x2) != color) continue; + diag = (fcol(row,col+1) == color && fcol(row+1,col) == color) ? 2:1; -- cgit v1.2.3