From eea4f94abbcace732aa4563233e15f4c37f0bcfa Mon Sep 17 00:00:00 2001 From: benoit Date: Sun, 15 Dec 2019 17:00:12 +0000 Subject: [PATCH] Update to jhead-3.04. --- graphics/jhead/Makefile | 4 +-- graphics/jhead/distinfo | 4 +-- graphics/jhead/patches/patch-gpsinfo_c | 25 +++++++---------- graphics/jhead/patches/patch-jhead_c | 39 ++++++++++---------------- graphics/jhead/patches/patch-makefile | 16 +++++++---- 5 files changed, 39 insertions(+), 49 deletions(-) diff --git a/graphics/jhead/Makefile b/graphics/jhead/Makefile index af000dd146e..7fd94efb544 100644 --- a/graphics/jhead/Makefile +++ b/graphics/jhead/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.24 2019/07/12 20:47:01 sthen Exp $ +# $OpenBSD: Makefile,v 1.25 2019/12/15 17:00:12 benoit Exp $ COMMENT = Exif jpeg camera setting parser and thumbnail remover -DISTNAME = jhead-3.03 +DISTNAME = jhead-3.04 CATEGORIES = graphics HOMEPAGE = http://www.sentex.net/~mwandel/jhead/ diff --git a/graphics/jhead/distinfo b/graphics/jhead/distinfo index 5094444c4bb..9022bd42c3e 100644 --- a/graphics/jhead/distinfo +++ b/graphics/jhead/distinfo @@ -1,2 +1,2 @@ -SHA256 (jhead-3.03.tar.gz) = ghlOASjZFBA4+C+ty1hFORyjAh1hvACBUHhgFhn2wMI= -SIZE (jhead-3.03.tar.gz) = 67762 +SHA256 (jhead-3.04.tar.gz) = 74m7z09sJe2ICIzyQqR6au3/9PCMx9wgW/PiwPEKA8k= +SIZE (jhead-3.04.tar.gz) = 67754 diff --git a/graphics/jhead/patches/patch-gpsinfo_c b/graphics/jhead/patches/patch-gpsinfo_c index 361039b9bfc..741dbb9b671 100644 --- a/graphics/jhead/patches/patch-gpsinfo_c +++ b/graphics/jhead/patches/patch-gpsinfo_c @@ -1,28 +1,23 @@ -$OpenBSD: patch-gpsinfo_c,v 1.5 2018/12/19 09:17:02 benoit Exp $ -Index: gpsinfo.c ---- gpsinfo.c.orig -+++ gpsinfo.c -@@ -145,9 +145,10 @@ void ProcessGpsInfo(unsigned char * DirStart, unsigned +$OpenBSD: patch-gpsinfo_c,v 1.6 2019/12/15 17:00:12 benoit Exp $ +--- gpsinfo.c.orig Sun Dec 15 17:46:17 2019 ++++ gpsinfo.c Sun Dec 15 17:48:33 2019 +@@ -146,7 +146,7 @@ FmtString[3+a*7] = (char)('0'+digits); Values[a] = ConvertAnyFormat(ValuePtr+a*ComponentSize, Format); - } + } -- sprintf(TempString, FmtString, Values[0], Values[1], Values[2]); -+ snprintf(TempString, sizeof(TempString), -+ FmtString, Values[0], Values[1], Values[2]); + snprintf(TempString, sizeof(TempString), FmtString, Values[0], Values[1], Values[2]); - if (Tag == TAG_GPS_LAT){ - strncpy(ImageInfo.GpsLat+2, TempString, 29); -@@ -161,8 +162,8 @@ void ProcessGpsInfo(unsigned char * DirStart, unsigned +@@ -162,8 +162,8 @@ break; case TAG_GPS_ALT: -- sprintf(ImageInfo.GpsAlt + 1, "%.2fm", -- ConvertAnyFormat(ValuePtr, Format)); -+ snprintf(ImageInfo.GpsAlt + 1, sizeof(ImageInfo.GpsAlt) + 1, -+ "%dm", Get32s(ValuePtr)); +- snprintf(ImageInfo.GpsAlt+1, sizeof(ImageInfo.GpsAlt)-1, +- "%.2fm", ConvertAnyFormat(ValuePtr, Format)); ++ snprintf(ImageInfo.GpsAlt+1, sizeof(ImageInfo.GpsAlt)+1, ++ "%.dm", Get32s(ValuePtr)); break; } diff --git a/graphics/jhead/patches/patch-jhead_c b/graphics/jhead/patches/patch-jhead_c index 68b2af3bf4a..d60ea2138e9 100644 --- a/graphics/jhead/patches/patch-jhead_c +++ b/graphics/jhead/patches/patch-jhead_c @@ -1,7 +1,7 @@ -Index: jhead.c ---- jhead.c.orig -+++ jhead.c -@@ -165,7 +165,8 @@ static int FileEditComment(char * TempFileName, char * +$OpenBSD: patch-jhead_c,v 1.14 2019/12/15 17:00:12 benoit Exp $ +--- jhead.c.orig Fri Nov 22 15:27:34 2019 ++++ jhead.c Sun Dec 15 17:39:14 2019 +@@ -165,7 +165,8 @@ } if (strlen(Editor) > PATH_MAX) ErrFatal("env too long"); @@ -11,7 +11,7 @@ Index: jhead.c a = system(QuotedPath); } -@@ -272,7 +273,8 @@ static int ModifyDescriptComment(char * OutComment, ch +@@ -272,7 +273,8 @@ if (!HasScandate && !ImageInfo.DateTime[0]){ // Scan date is not in the file yet, and it doesn't have one built in. Add it. char Temp[40]; @@ -21,7 +21,7 @@ Index: jhead.c strncat(OutComment, Temp, MAX_COMMENT_SIZE-5-strlen(OutComment)); Modified = TRUE; } -@@ -304,8 +306,10 @@ static int AutoResizeCmdStuff(void) +@@ -304,8 +306,10 @@ if (scale < 0.4) scale = 0.4; // Don't scale down by too much. @@ -34,7 +34,7 @@ Index: jhead.c return TRUE; } -@@ -632,7 +636,8 @@ static void DoFileRenaming(const char * FileName) +@@ -632,7 +636,8 @@ memcpy(pat, pattern+ppos, 4); pat[a-ppos] = 'd'; // Replace 'i' with 'd' for '%d' pat[a-ppos+1] = '\0'; @@ -44,7 +44,7 @@ Index: jhead.c nl = strlen(num); l = strlen(pattern+a+1); if (ppos+nl+l+1 >= PATH_MAX) ErrFatal("str overflow"); -@@ -648,7 +653,7 @@ static void DoFileRenaming(const char * FileName) +@@ -648,7 +653,7 @@ strftime(NewName, PATH_MAX, pattern, &tm); }else{ // My favourite scheme. @@ -53,16 +53,7 @@ Index: jhead.c tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); } -@@ -677,7 +682,7 @@ static void DoFileRenaming(const char * FileName) - NameExtra[0] = 0; - } - -- sprintf(NewName, "%s%s.jpg", NewBaseName, NameExtra); -+ snprintf(NewName, sizeof(NewName), "%s%s.jpg", NewBaseName, NameExtra); - - if (!strcmp(FileName, NewName)) break; // Skip if its already this name. - -@@ -692,7 +697,8 @@ static void DoFileRenaming(const char * FileName) +@@ -692,7 +697,8 @@ printf("%s --> %s\n",FileName, NewName); #ifdef _WIN32 if (RenameAssociatedFiles){ @@ -72,7 +63,7 @@ Index: jhead.c RenameAssociated(FileName, NewName); } #endif -@@ -726,7 +732,8 @@ static int DoAutoRotate(const char * FileName) +@@ -726,7 +732,8 @@ // Unknown orientation, but still modified. return TRUE; // Image is still modified. } @@ -82,7 +73,7 @@ Index: jhead.c ApplyCommand = RotateCommand; DoCommand(FileName, FALSE); ApplyCommand = NULL; -@@ -745,7 +752,8 @@ static int DoAutoRotate(const char * FileName) +@@ -745,7 +752,8 @@ strcpy(ThumbTempName_out, FileName); strcat(ThumbTempName_out, ".tho"); SaveThumbnail(ThumbTempName_in); @@ -92,17 +83,17 @@ Index: jhead.c Argument, ThumbTempName_out, ThumbTempName_in); if (system(RotateCommand) == 0){ -@@ -773,7 +781,8 @@ static int RegenerateThumbnail(const char * FileName) +@@ -773,7 +781,8 @@ return FALSE; } -- sprintf(ThumbnailGenCommand, "mogrify -thumbnail %dx%d \"%s\"", +- sprintf(ThumbnailGenCommand, "mogrify -thumbnail %dx%d -quality 80 \"%s\"", + snprintf(ThumbnailGenCommand, sizeof(ThumbnailGenCommand), -+ "mogrify -thumbnail %dx%d \"%s\"", ++ "mogrify -thumbnail %dx%d -quality 80 \"%s\"", RegenThumbnail, RegenThumbnail, FileName); if (system(ThumbnailGenCommand) == 0){ -@@ -1143,7 +1152,7 @@ static void ProcessFile(const char * FileName) +@@ -1143,7 +1152,7 @@ // Print to temp buffer first to avoid putting null termination in destination. // snprintf() would do the trick, hbut not available everywhere (like FreeBSD 4.4) diff --git a/graphics/jhead/patches/patch-makefile b/graphics/jhead/patches/patch-makefile index af079c63278..d0e0905c0d8 100644 --- a/graphics/jhead/patches/patch-makefile +++ b/graphics/jhead/patches/patch-makefile @@ -1,12 +1,16 @@ -$OpenBSD: patch-makefile,v 1.4 2013/03/08 07:54:31 benoit Exp $ ---- makefile.orig Wed Jan 30 18:02:56 2013 -+++ makefile Tue Mar 5 15:01:56 2013 -@@ -3,7 +3,7 @@ +$OpenBSD: patch-makefile,v 1.5 2019/12/15 17:00:12 benoit Exp $ +--- makefile.orig Sun Dec 15 17:42:24 2019 ++++ makefile Sun Dec 15 17:44:29 2019 +@@ -3,9 +3,9 @@ #-------------------------------- OBJ=. SRC=. --CFLAGS:= $(CFLAGS) -O3 -Wall -+CFLAGS:= $(CFLAGS) -Wall +-CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) +-CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) +-LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) ++CPPFLAGS:=$(CPPFLAGS) ++CFLAGS:=$(CFLAGS) -Wall ++LDFLAGS:=$(LDFLAGS) all: jhead