Hello community,
here is the log from the commit of package jhead for openSUSE:Factory checked in at 2015-04-28 20:48:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jhead (Old)
and /work/SRC/openSUSE:Factory/.jhead.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jhead"
Changes:
--------
--- /work/SRC/openSUSE:Factory/jhead/jhead.changes 2013-03-11 10:09:41.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.jhead.new/jhead.changes 2015-04-28 20:48:09.000000000 +0200
@@ -1,0 +2,12 @@
+Mon Apr 27 17:44:31 UTC 2015 - mpluskal@suse.com
+
+- Update to version 3.00
+ * Make max comment size 16000
+ * Added "-zt" option to trim 32k of trailing zeroes from Nikon 1
+ J2 and J3 images.
+ * Add ability to reset invalid rotation tag (from Moultrie
+ game cameras)
+- Use url for source
+- Cleanup spec file with spec-cleaner
+
+-------------------------------------------------------------------
Old:
----
jhead-2.97.tar.gz
New:
----
jhead-3.00.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ jhead.spec ++++++
--- /var/tmp/diff_new_pack.UbxsNS/_old 2015-04-28 20:48:10.000000000 +0200
+++ /var/tmp/diff_new_pack.UbxsNS/_new 2015-04-28 20:48:10.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package jhead
#
-# Copyright (c) 2013 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
@@ -17,15 +17,16 @@
Name: jhead
-Version: 2.97
+Version: 3.00
Release: 0
-Requires: %{_bindir}/jpegtran
-Requires: %{_bindir}/mogrify
Summary: Tool to Manipulate the Nonimage Part of EXIF Compliant JPEG Files
License: SUSE-Public-Domain
Group: Productivity/Graphics/Other
Url: http://www.sentex.net/~mwandel/jhead/
-Source: %{name}-%{version}.tar.gz
+Source0: http://www.sentex.net/~mwandel/jhead/jhead-%{version}.tar.gz
+Source1: %{name}.changes
+Requires: %{_bindir}/jpegtran
+Requires: %{_bindir}/mogrify
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -36,31 +37,25 @@
digital camera JPEG files without loss of information by deleting
thumbnails that digital cameras put into the EXIF header.
-
-
-Authors:
---------
- Matthias Wandel
-
%prep
%setup -q
-modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
+modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE1}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
%build
-make CC="gcc %optflags -D__DATE__=$DATE"
+make %{?_smp_mflags} CC="cc %{optflags} -D__DATE__=$DATE"
%install
-install -d -m 755 %buildroot%{_bindir}
-install -d -m 755 %buildroot%{_mandir}/man1
-install -m 755 jhead %buildroot%{_bindir}
-install -m 644 jhead.1 %buildroot%{_mandir}/man1
+install -d -m 755 %{buildroot}%{_bindir}
+install -d -m 755 %{buildroot}%{_mandir}/man1
+install -m 755 jhead %{buildroot}%{_bindir}
+install -m 644 jhead.1 %{buildroot}%{_mandir}/man1
%files
%defattr(-,root,root)
%doc changes.txt readme.txt usage.html
%{_bindir}/*
-%doc %{_mandir}/man1/*.*
+%{_mandir}/man1/*.*
%changelog
++++++ jhead-2.97.tar.gz -> jhead-3.00.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/changes.txt new/jhead-3.00/changes.txt
--- old/jhead-2.97/changes.txt 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/changes.txt 2015-02-02 23:24:06.000000000 +0100
@@ -399,4 +399,14 @@
Fix crash on some corrupt files bug, clarify time adjustment syntax in help
--------Released version 2.97 -- Jan 30 2013 --------
\ No newline at end of file
+-------Released version 2.97 -- Jan 30 2013 --------
+Jun 10 2013:
+Make max comment size 16000
+
+Oct 25 2013:
+Added "-zt" option to trim 32k of trailing zeroes from Nikon 1 J2 and J3 images.
+
+Sep 28 2014:
+Add ability to reset invalid rotation tag (from Moultrie game cameras)
+
+-------Released version 3.0 -- Feb 2 2015 --------
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/exif.c new/jhead-3.00/exif.c
--- old/jhead-2.97/exif.c 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/exif.c 2015-02-02 23:24:06.000000000 +0100
@@ -489,7 +489,7 @@
}
}
if (DumpExifMap){
- printf("Map: %05d-%05d: Directory\n",(int)(DirStart-OffsetBase), (int)(DirEnd+4-OffsetBase));
+ printf("Map: %05u-%05u: Directory\n",(int)(DirStart-OffsetBase), (int)(DirEnd+4-OffsetBase));
}
@@ -539,7 +539,7 @@
}
if (DumpExifMap){
- printf("Map: %05d-%05d: Data for tag %04x\n",OffsetVal, OffsetVal+ByteCount, Tag);
+ printf("Map: %05u-%05u: Data for tag %04x\n",OffsetVal, OffsetVal+ByteCount, Tag);
}
}else{
// 4 bytes or less and value is in the dir entry itself
@@ -744,7 +744,7 @@
case TAG_ORIENTATION:
if (NumOrientations >= 2){
// Can have another orientation tag for the thumbnail, but if there's
- // a third one, things are stringae.
+ // a third one, things are strange.
ErrNonfatal("More than two orientation in Exif",0,0);
break;
}
@@ -755,7 +755,6 @@
}
if (ImageInfo.Orientation < 0 || ImageInfo.Orientation > 8){
ErrNonfatal("Undefined rotation value %d in Exif", ImageInfo.Orientation, 0);
- ImageInfo.Orientation = 0;
}
NumOrientations += 1;
break;
@@ -967,7 +966,7 @@
ImageInfo.ThumbnailSize = ThumbnailSize;
if (ShowTags){
- printf("Thumbnail size: %d bytes\n",ThumbnailSize);
+ printf("Thumbnail size: %u bytes\n",ThumbnailSize);
}
}
}
@@ -988,7 +987,7 @@
NumOrientations = 0;
if (ShowTags){
- printf("Exif header %d bytes long\n",length);
+ printf("Exif header %u bytes long\n",length);
}
{ // Check the EXIF header component
@@ -1238,7 +1237,11 @@
}
}
- return OrientTab[ImageInfo.Orientation];
+ if (ImageInfo.Orientation >= 1 && ImageInfo.Orientation <= 8){
+ return OrientTab[ImageInfo.Orientation];
+ }else{
+ return NULL;
+ }
}
//--------------------------------------------------------------------------
@@ -1307,7 +1310,7 @@
}
printf("Resolution : %d x %d\n",ImageInfo.Width, ImageInfo.Height);
- if (ImageInfo.Orientation > 1){
+ if (ImageInfo.Orientation > 1 && ImageInfo.Orientation <=8){
// Only print orientation if one was supplied, and if its not 1 (normal orientation)
printf("Orientation : %s\n", OrientTab[ImageInfo.Orientation]);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/jhead.1 new/jhead-3.00/jhead.1
--- old/jhead-2.97/jhead.1 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/jhead.1 2015-02-02 23:24:06.000000000 +0100
@@ -1,4 +1,4 @@
-.TH JHEAD 1 "30 Jan 2013" "jhead 2.97"
+.TH JHEAD 1 "2 Feb 2015" "jhead 3.00"
.SH NAME
jhead \- Digicam JPEG Exif header manipulation tool
.SH SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/jhead.c new/jhead-3.00/jhead.c
--- old/jhead-2.97/jhead.c 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/jhead.c 2015-02-02 23:24:06.000000000 +0100
@@ -2,12 +2,12 @@
// Program to pull the information out of various types of EXIF digital
// camera files and show it in a reasonably consistent way
//
-// Version 2.97
+// Version 3.00
//
// Compiling under Windows:
// Make sure you have Microsoft's compiler on the path, then run make.bat
//
-// Dec 1999 - Jan 2013
+// Dec 1999 - Feb 2015
//
// by Matthias Wandel www.sentex.net/~mwandel
//--------------------------------------------------------------------------
@@ -19,7 +19,7 @@
#include
-#define JHEAD_VERSION "2.97"
+#define JHEAD_VERSION "3.00"
// This #define turns on features that are too very specific to
// how I organize my photos. Best to ignore everything inside #ifdef MATTHIAS
@@ -56,6 +56,7 @@
int DumpExifMap = FALSE;
static int ShowConcise = FALSE;
static int CreateExifSection = FALSE;
+static int TrimExifTrailingZeroes = FALSE;
static char * ApplyCommand = NULL; // Apply this command to all images.
static char * FilterModel = NULL;
static int ExifOnly = FALSE;
@@ -178,7 +179,7 @@
}
// Read the file back in.
- CommentSize = fread(Comment, 1, 999, file);
+ CommentSize = fread(Comment, 1, MAX_COMMENT_SIZE, file);
fclose(file);
@@ -243,6 +244,7 @@
if (!memcmp(Line, AddComment, l+1)){
TagExists = TRUE;
strncpy(Line, AddComment, sizeof(Line));
+ Line[sizeof(Line)-1]='\0';
Modified = TRUE;
}
}
@@ -282,21 +284,27 @@
{
static char CommandString[PATH_MAX+1];
double scale;
- float TargetSize = 1600;
+ float TargetSize = 1800;
ApplyCommand = CommandString;
scale = TargetSize / ImageInfo.Width;
- if (TargetSize / ImageInfo.Height > scale) scale = TargetSize / ImageInfo.Width;
+ if (scale > TargetSize / ImageInfo.Height) scale = TargetSize / ImageInfo.Height;
if (scale > 0.8){
+ if (ImageInfo.QualityGuess >= 93){
+ // Re-compress at lower quality.
+ sprintf(CommandString, "mogrify -quality 86 &i");
+ return TRUE;
+ }
printf("not resizing %dx%x '%s'\n",ImageInfo.Height, ImageInfo.Width, ImageInfo.FileName);
return FALSE;
}
if (scale < 0.4) scale = 0.4; // Don't scale down by too much.
- sprintf(CommandString, "mogrify -geometry %dx%d -quality 80 &i",(int)(ImageInfo.Width*scale), (int)(ImageInfo.Height*scale));
+ sprintf(CommandString, "mogrify -geometry %dx%d -quality 85 &i",(int)(ImageInfo.Width*scale+0.5),
+ (int)(ImageInfo.Height*scale+0.5));
return TRUE;
}
@@ -411,8 +419,21 @@
// Don't delete original file until we know a new one was created by the command.
struct stat dummy;
if (stat(TempName, &dummy) == 0){
+ struct stat buf;
+ int stat_result = stat(FileName, &buf);
+
unlink(FileName);
rename(TempName, FileName);
+ if (stat_result == 0){
+ // set Unix access rights and time to new file
+ struct utimbuf mtime;
+ chmod(FileName, buf.st_mode);
+
+ mtime.actime = buf.st_atime;
+ mtime.modtime = buf.st_mtime;
+
+ utime(FileName, &mtime);
+ }
}else{
ErrFatal("specified command did not produce expected output file");
}
@@ -539,8 +560,6 @@
//--------------------------------------------------------------------------
static void DoFileRenaming(const char * FileName)
{
- int NumAlpha = 0;
- int NumDigit = 0;
int PrefixPart = 0; // Where the actual filename starts.
int ExtensionPart; // Where the file extension starts.
int a;
@@ -553,15 +572,10 @@
for (a=0;FileName[a];a++){
if (FileName[a] == SLASH){
// Don't count path component.
- NumAlpha = 0;
- NumDigit = 0;
PrefixPart = a+1;
}
if (FileName[a] == '.') ExtensionPart = a; // Remember where extension starts.
-
- if (isalpha(FileName[a])) NumAlpha += 1; // Tally up alpha vs. digits to judge wether to rename.
- if (isdigit(FileName[a])) NumDigit += 1;
}
if (!Exif2tm(&tm, ImageInfo.DateTime)){
@@ -694,16 +708,16 @@
//--------------------------------------------------------------------------
static int DoAutoRotate(const char * FileName)
{
- if (ImageInfo.Orientation >= 2 && ImageInfo.Orientation <= 8){
+ if (ImageInfo.Orientation != 1){
const char * Argument;
Argument = ClearOrientation();
if (!ZeroRotateTagOnly){
char RotateCommand[PATH_MAX*2+50];
if (Argument == NULL){
- ErrFatal("Orientation screwup");
+ ErrNonfatal("Unknown orientation tag",0,0);
+ return TRUE; // Image is still modified.
}
-
sprintf(RotateCommand, "jpegtran -trim -%s -outfile &o &i", Argument);
ApplyCommand = RotateCommand;
DoCommand(FileName, FALSE);
@@ -859,8 +873,9 @@
Modified = TRUE;
}
ReadMode = READ_IMAGE; // Don't re-read exif section again on next read.
-
- }else if (ExifXferScrFile){
+ }
+
+ if (ExifXferScrFile){
char RelativeExifName[PATH_MAX+1];
// Make a relative name.
@@ -885,6 +900,35 @@
return;
}
+ if (TrimExifTrailingZeroes){
+ if (ImageInfo.ThumbnailAtEnd){
+ Section_t * ExifSection;
+ int NumRedundant, WasRedundant;
+ unsigned char * StartRedundant;
+ //printf("Exif: Thumbnail %d - %d\n",ImageInfo.ThumbnailOffset, ImageInfo.ThumbnailOffset+ImageInfo.ThumbnailSize);
+ ExifSection = FindSection(M_EXIF);
+
+ StartRedundant = ExifSection->Data + 8 + ImageInfo.ThumbnailOffset+ImageInfo.ThumbnailSize;
+ WasRedundant = NumRedundant = (ExifSection->Size) - (ImageInfo.ThumbnailOffset + ImageInfo.ThumbnailSize + 8);
+
+ //printf("Exif length: %d Wasted: %d\n",ExifSection->Size, NumRedundant);
+
+ for(;NumRedundant > 0 && StartRedundant[NumRedundant-1] == 0;NumRedundant--);// Only remove trailing bytes if they are zero.
+
+ if (NumRedundant != WasRedundant){
+ int NewExifSize;
+ printf("Trimming %d bytes from exif in %s\n", WasRedundant-NumRedundant, FileName);
+ NewExifSize = ImageInfo.ThumbnailOffset + ImageInfo.ThumbnailSize + 8 + NumRedundant;
+ ExifSection->Data[0] = (uchar)(NewExifSize >> 8); // Must write new length into exif data.
+ ExifSection->Data[1] = (uchar)NewExifSize;
+ ExifSection->Size = NewExifSize;
+ Modified = TRUE;
+ }else{
+ //printf("Noting to remove from %s\n", FileName);
+ }
+ }
+ }
+
FileSequence += 1; // Count files processed.
if (ShowConcise){
@@ -985,7 +1029,7 @@
}else{
// Read it in.
// Replace the section.
- CommentSize = fread(Comment, 1, 999, CommentFile);
+ CommentSize = fread(Comment, 1, MAX_COMMENT_SIZE, CommentFile);
fclose(CommentFile);
if (CommentSize < 0) CommentSize = 0;
}
@@ -1044,9 +1088,8 @@
RelativeName(OutFileName, CommentSavefileName, FileName);
CommentFile = fopen(OutFileName,"w");
-
if (CommentFile){
- fwrite((char *)CommentSec->Data+2, CommentSec->Size-2 ,1, CommentFile);
+ fwrite((char *)CommentSec->Data+2 ,CommentSec->Size-2, 1, CommentFile);
fclose(CommentFile);
}else{
ErrFatal("Could not write comment file");
@@ -1233,6 +1276,7 @@
" -ci <name> Insert comment section from a file. -cs and -ci use same naming\n"
" scheme as used by the -st option\n"
" -cl string Insert literal comment string\n"
+ " -zt Trim exif header trailing zeroes (Nikon 1 wastes 30k that way)\n"
"\nDATE / TIME MANIPULATION:\n"
" -ft Set file modification time to Exif time\n"
@@ -1442,10 +1486,12 @@
}else if (!strcmp(arg,"-cl")){
CommentInsertLiteral = argv[++argn];
DoModify |= MODIFY_JPEG;
+ }else if (!strcmp(arg,"-zt")){
+ TrimExifTrailingZeroes = TRUE;
+ DoModify |= MODIFY_JPEG;
}else if (!strcmp(arg,"-mkexif")){
CreateExifSection = TRUE;
DoModify |= MODIFY_JPEG;
-
// Output verbosity control
}else if (!strcmp(arg,"-h")){
Usage();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/jhead.h new/jhead-3.00/jhead.h
--- old/jhead-2.97/jhead.h 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/jhead.h 2015-02-02 23:24:06.000000000 +0100
@@ -40,7 +40,7 @@
#define FALSE 0
#endif
-#define MAX_COMMENT_SIZE 2000
+#define MAX_COMMENT_SIZE 16000
#ifdef _WIN32
#define PATH_MAX _MAX_PATH
@@ -89,7 +89,7 @@
char CameraMake [32];
char CameraModel [40];
char DateTime [20];
- int Height, Width;
+ unsigned Height, Width;
int Orientation;
int IsColor;
int Process;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/makefile-win32 new/jhead-3.00/makefile-win32
--- old/jhead-2.97/makefile-win32 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/makefile-win32 2015-02-02 23:24:06.000000000 +0100
@@ -11,7 +11,7 @@
all:jhead.exe
-OBJ = .
+OBJ = obj
OBJECTS_JHEAD = $(OBJ)\jhead.obj \
$(OBJ)\jpgfile.obj \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/makernote.c new/jhead-3.00/makernote.c
--- old/jhead-2.97/makernote.c 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/makernote.c 2015-02-02 23:24:06.000000000 +0100
@@ -28,7 +28,7 @@
}
if (DumpExifMap){
- printf("Map: %05d-%05d: Directory (makernote)\n",(int)(DirStart-OffsetBase), (int)(DirEnd-OffsetBase));
+ printf("Map: %05u-%05u: Directory (makernote)\n",(int)(DirStart-OffsetBase), (int)(DirEnd-OffsetBase));
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jhead-2.97/myglob.c new/jhead-3.00/myglob.c
--- old/jhead-2.97/myglob.c 2013-01-30 18:02:56.000000000 +0100
+++ new/jhead-3.00/myglob.c 2015-02-02 23:24:06.000000000 +0100
@@ -256,14 +256,12 @@
{
int argn;
char * arg;
- int Subdirs = 0;
for (argn=1;argn