Bug#733608: jhead: Comment removed when adjusting time
Hello Sylvain, I tried to get some help from the upstream maintainer of jhead. But he is not helping :-( He refused your patch and do not propose any alternative. I will keep this bug open but will not work on it anymore. Bye Le 07/01/2014 19:40, Matthias Wandel a écrit : yes -Original Message- From: Ludovic Rousseau Sent: Tuesday, January 07, 2014 12:47 PM To: Matthias Wandel ; 733...@bugs.debian.org Subject: Re: Bug#733608: jhead: Comment removed when adjusting time Le 05/01/2014 22:41, Matthias Wandel a écrit : I wasn't aware that it changed it for time adjustments. How a user of jhead is supposed to change the EXIF date & time without changing the comments? The "-ta" command has a side effect of also changing the comments. Thanks -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#733608: jhead: Comment removed when adjusting time
yes -Original Message- From: Ludovic Rousseau Sent: Tuesday, January 07, 2014 12:47 PM To: Matthias Wandel ; 733...@bugs.debian.org Subject: Re: Bug#733608: jhead: Comment removed when adjusting time Le 05/01/2014 22:41, Matthias Wandel a écrit : I wasn't aware that it changed it for time adjustments. How a user of jhead is supposed to change the EXIF date & time without changing the comments? The "-ta" command has a side effect of also changing the comments. Thanks -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#733608: jhead: Comment removed when adjusting time
Le 05/01/2014 22:41, Matthias Wandel a écrit : I wasn't aware that it changed it for time adjustments. How a user of jhead is supposed to change the EXIF date & time without changing the comments? The "-ta" command has a side effect of also changing the comments. Thanks -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#733608: jhead: Comment removed when adjusting time
I wasn't aware that it changed it for time adjustments. Matthias -Original Message- From: Ludovic Rousseau Sent: Sunday, January 05, 2014 4:20 PM To: Matthias Wandel ; 733...@bugs.debian.org Subject: Re: Bug#733608: jhead: Comment removed when adjusting time Le 05/01/2014 21:57, Matthias Wandel a écrit : Yes. Use jhead in a different way. According to the jhead documentation "jhead -ta-1 DSC.JPG" should change the time, not the comments. It looks like a jhead bug (or at least an undocumented feature). How do you propose to use jhead to change the time only? Can you be more explicit about the feature that the proposed patch do remove? Thanks -Original Message- From: Ludovic Rousseau Sent: Sunday, January 05, 2014 2:27 PM To: Matthias Wandel Cc: 733...@bugs.debian.org Subject: Re: Fwd: Bug#733608: jhead: Comment removed when adjusting time 2014/1/5 Matthias Wandel : That patch removes a feature. I'm not taking it. OK. Can you propose another solution to solve the problem reported by the user? Bye -Original Message- From: Ludovic Rousseau Sent: Sunday, January 05, 2014 12:52 PM To: Matthias Wandel Subject: Fwd: Bug#733608: jhead: Comment removed when adjusting time Hello Matthias, Here is a new bug report for jhead. I don't know if the patch is correct. Bye -- Forwarded message -- From: Sylvain LEVEQUE Date: 2013/12/30 Subject: Bug#733608: jhead: Comment removed when adjusting time To: Debian Bug Tracking System Package: jhead Version: 1:2.97-1 Severity: normal Dear Maintainer, While adjusting some EXIF dates on pictures, the observed change between the original picture and the jhead-ed one goes beyond time modifications of the corresponding tags. The default EXIF comment from my camera is a sequence of spaces, which translates inside the header to "ASCII\0\0\0 " (36 spaces overall). This is basically my workflow: cp -p DSC.JPG DSC_orig.JPG jhead -ta-1 DSC.JPG hexdump -Cv DSC_orig.JPG > DSC_orig.txt hexdump -Cv DSC.JPG > DSC.txt `diff DSC_orig.txt DSC.txt` returns 17c17 < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55. | --- 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55. | 56,57c56,57 < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 12:25:55.| < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 12:25| --- 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 11:25:55.| 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 11:25| 60,62c60,62 < 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 20 20 20 20 |ASCII... | < 03c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | < 03d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | --- 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 00 00 00 00 |ASCII...| 03c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || 03d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || I expect the output to be 17c17 < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55. | --- 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55. | 56,57c56,57 < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 12:25:55.| < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 12:25| --- 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 11:25:55.| 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 11:25| I tracked the issue down to exif.c where the code takes conditional actions on the comment field. It will remove trailing spaces and replace them with \0, then conditionnally copy the comment if one of the five first characters after the 'ASCII' string is different from a space of \0. I expect this situation to lead to a corner case bug (untested): a comment starting with several spaces will be wiped when adjusting time. I also think this happens upon creation of the modified file and is likely not limited to the -ta option. The issue is not Debian specific but in the upstream code. A patch is attached to suggest a more conservative behaviour of jhead. Thank you -- Sylvain -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (990, 'testing'), (50, 'unstable'), (40, 'experimental') Architecture: armel (armv5tel) Kernel: Linux 3.11-2-kirkwood Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages jhead depends on: ii libc6 2.17-97 ii libjpeg-progs 8d-2 jhead recommends no packages. Versions of packages jhead suggests: ii imagemagick 8:6.7.7.10-7 -- no debconf information -- Dr. Ludovic Rousseau -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE,
Bug#733608: jhead: Comment removed when adjusting time
Le 05/01/2014 21:57, Matthias Wandel a écrit : Yes. Use jhead in a different way. According to the jhead documentation "jhead -ta-1 DSC.JPG" should change the time, not the comments. It looks like a jhead bug (or at least an undocumented feature). How do you propose to use jhead to change the time only? Can you be more explicit about the feature that the proposed patch do remove? Thanks -Original Message- From: Ludovic Rousseau Sent: Sunday, January 05, 2014 2:27 PM To: Matthias Wandel Cc: 733...@bugs.debian.org Subject: Re: Fwd: Bug#733608: jhead: Comment removed when adjusting time 2014/1/5 Matthias Wandel : That patch removes a feature. I'm not taking it. OK. Can you propose another solution to solve the problem reported by the user? Bye -Original Message- From: Ludovic Rousseau Sent: Sunday, January 05, 2014 12:52 PM To: Matthias Wandel Subject: Fwd: Bug#733608: jhead: Comment removed when adjusting time Hello Matthias, Here is a new bug report for jhead. I don't know if the patch is correct. Bye -- Forwarded message -- From: Sylvain LEVEQUE Date: 2013/12/30 Subject: Bug#733608: jhead: Comment removed when adjusting time To: Debian Bug Tracking System Package: jhead Version: 1:2.97-1 Severity: normal Dear Maintainer, While adjusting some EXIF dates on pictures, the observed change between the original picture and the jhead-ed one goes beyond time modifications of the corresponding tags. The default EXIF comment from my camera is a sequence of spaces, which translates inside the header to "ASCII\0\0\0 " (36 spaces overall). This is basically my workflow: cp -p DSC.JPG DSC_orig.JPG jhead -ta-1 DSC.JPG hexdump -Cv DSC_orig.JPG > DSC_orig.txt hexdump -Cv DSC.JPG > DSC.txt `diff DSC_orig.txt DSC.txt` returns 17c17 < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55. | --- 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55. | 56,57c56,57 < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 12:25:55.| < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 12:25| --- 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 11:25:55.| 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 11:25| 60,62c60,62 < 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 20 20 20 20 |ASCII... | < 03c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | < 03d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | --- 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 00 00 00 00 |ASCII...| 03c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || 03d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || I expect the output to be 17c17 < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55. | --- 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55. | 56,57c56,57 < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 12:25:55.| < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 12:25| --- 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 11:25:55.| 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 11:25| I tracked the issue down to exif.c where the code takes conditional actions on the comment field. It will remove trailing spaces and replace them with \0, then conditionnally copy the comment if one of the five first characters after the 'ASCII' string is different from a space of \0. I expect this situation to lead to a corner case bug (untested): a comment starting with several spaces will be wiped when adjusting time. I also think this happens upon creation of the modified file and is likely not limited to the -ta option. The issue is not Debian specific but in the upstream code. A patch is attached to suggest a more conservative behaviour of jhead. Thank you -- Sylvain -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (990, 'testing'), (50, 'unstable'), (40, 'experimental') Architecture: armel (armv5tel) Kernel: Linux 3.11-2-kirkwood Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages jhead depends on: ii libc6 2.17-97 ii libjpeg-progs 8d-2 jhead recommends no packages. Versions of packages jhead suggests: ii imagemagick 8:6.7.7.10-7 -- no debconf information -- Dr. Ludovic Rousseau -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#733608: Fwd: Bug#733608: jhead: Comment removed when adjusting time
2014/1/5 Matthias Wandel : > That patch removes a feature. I'm not taking it. OK. Can you propose another solution to solve the problem reported by the user? Bye > -Original Message- From: Ludovic Rousseau > Sent: Sunday, January 05, 2014 12:52 PM > To: Matthias Wandel > Subject: Fwd: Bug#733608: jhead: Comment removed when adjusting time > > > Hello Matthias, > > Here is a new bug report for jhead. > I don't know if the patch is correct. > > Bye > > > -- Forwarded message -- > From: Sylvain LEVEQUE > Date: 2013/12/30 > Subject: Bug#733608: jhead: Comment removed when adjusting time > To: Debian Bug Tracking System > > > Package: jhead > Version: 1:2.97-1 > Severity: normal > > Dear Maintainer, > > While adjusting some EXIF dates on pictures, the observed change > between the original picture and the jhead-ed one goes beyond time > modifications of the corresponding tags. > > The default EXIF comment from my camera is a sequence of spaces, which > translates inside the header to "ASCII\0\0\0 " (36 > spaces overall). > > This is basically my workflow: > cp -p DSC.JPG DSC_orig.JPG > jhead -ta-1 DSC.JPG > hexdump -Cv DSC_orig.JPG > DSC_orig.txt > hexdump -Cv DSC.JPG > DSC.txt > > `diff DSC_orig.txt DSC.txt` returns > 17c17 > < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55. | > --- >> >> 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55. | > > 56,57c56,57 > < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 > 12:25:55.| > < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 > 12:25| > --- >> >> 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 >> 11:25:55.| >> 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 >> 11:25| > > 60,62c60,62 > < 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 20 20 20 20 |ASCII... > | > < 03c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > < 03d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > --- >> >> 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 00 00 00 00 >> |ASCII...| >> 03c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> || >> 03d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> || > > > > I expect the output to be > 17c17 > < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55. | > --- >> >> 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55. | > > 56,57c56,57 > < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 > 12:25:55.| > < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 > 12:25| > --- >> >> 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 >> 11:25:55.| >> 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 >> 11:25| > > > > I tracked the issue down to exif.c where the code takes conditional > actions on the comment field. It will remove trailing spaces and > replace them with \0, then conditionnally copy the comment if one of > the five first characters after the 'ASCII' string is different from a > space of \0. > > I expect this situation to lead to a corner case bug (untested): a > comment starting with several spaces will be wiped when adjusting > time. > > I also think this happens upon creation of the modified file and is > likely not limited to the -ta option. > > The issue is not Debian specific but in the upstream code. A patch is > attached to suggest a more conservative behaviour of jhead. > > Thank you > -- > Sylvain > > -- System Information: > Debian Release: jessie/sid > APT prefers testing > APT policy: (990, 'testing'), (50, 'unstable'), (40, 'experimental') > Architecture: armel (armv5tel) > > Kernel: Linux 3.11-2-kirkwood > Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) > Shell: /bin/sh linked to /bin/dash > > Versions of packages jhead depends on: > ii libc6 2.17-97 > ii libjpeg-progs 8d-2 > > jhead recommends no packages. > > Versions of packages jhead suggests: > ii imagemagick 8:6.7.7.10-7 > > -- no debconf information > > > -- > Dr. Ludovic Rousseau -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#733608: jhead: Comment removed when adjusting time
Le 30/12/2013 13:00, Sylvain LEVEQUE a écrit : The issue is not Debian specific but in the upstream code. A patch is attached to suggest a more conservative behaviour of jhead. Thanks. I forwarded the bug upstream. -- Dr. Ludovic Rousseau -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#733608: jhead: Comment removed when adjusting time
Package: jhead Version: 1:2.97-1 Severity: normal Dear Maintainer, While adjusting some EXIF dates on pictures, the observed change between the original picture and the jhead-ed one goes beyond time modifications of the corresponding tags. The default EXIF comment from my camera is a sequence of spaces, which translates inside the header to "ASCII\0\0\0 " (36 spaces overall). This is basically my workflow: cp -p DSC.JPG DSC_orig.JPG jhead -ta-1 DSC.JPG hexdump -Cv DSC_orig.JPG > DSC_orig.txt hexdump -Cv DSC.JPG > DSC.txt `diff DSC_orig.txt DSC.txt` returns 17c17 < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55.| --- > 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55.| 56,57c56,57 < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 12:25:55.| < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 12:25| --- > 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 11:25:55.| > 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 11:25| 60,62c60,62 < 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 20 20 20 20 |ASCII...| < 03c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 || < 03d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 || --- > 03b0 00 00 00 0a 41 53 43 49 49 00 00 00 00 00 00 00 |ASCII...| > 03c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || > 03d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || I expect the output to be 17c17 < 0100 32 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |2:25:55.| --- > 0100 31 3a 32 35 3a 35 35 00 20 20 20 20 20 20 20 20 |1:25:55.| 56,57c56,57 < 0370 3a 31 32 3a 32 35 20 31 32 3a 32 35 3a 35 35 00 |:12:25 12:25:55.| < 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 32 3a 32 35 |2013:12:25 12:25| --- > 0370 3a 31 32 3a 32 35 20 31 31 3a 32 35 3a 35 35 00 |:12:25 11:25:55.| > 0380 32 30 31 33 3a 31 32 3a 32 35 20 31 31 3a 32 35 |2013:12:25 11:25| I tracked the issue down to exif.c where the code takes conditional actions on the comment field. It will remove trailing spaces and replace them with \0, then conditionnally copy the comment if one of the five first characters after the 'ASCII' string is different from a space of \0. I expect this situation to lead to a corner case bug (untested): a comment starting with several spaces will be wiped when adjusting time. I also think this happens upon creation of the modified file and is likely not limited to the -ta option. The issue is not Debian specific but in the upstream code. A patch is attached to suggest a more conservative behaviour of jhead. Thank you -- Sylvain -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (990, 'testing'), (50, 'unstable'), (40, 'experimental') Architecture: armel (armv5tel) Kernel: Linux 3.11-2-kirkwood Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages jhead depends on: ii libc6 2.17-97 ii libjpeg-progs 8d-2 jhead recommends no packages. Versions of packages jhead suggests: ii imagemagick 8:6.7.7.10-7 -- no debconf information diff -ru jhead.orig/jhead-2.97/exif.c jhead/jhead-2.97/exif.c --- jhead.orig/jhead-2.97/exif.c 2013-01-30 18:02:56.0 +0100 +++ jhead/jhead-2.97/exif.c 2013-12-30 12:16:47.037757973 +0100 @@ -663,33 +663,12 @@ break; // Already have a windows comment, skip this one. } -// Comment is often padded with trailing spaces. Remove these first. -for (a=ByteCount;;){ -a--; -if ((ValuePtr)[a] == ' '){ -(ValuePtr)[a] = '\0'; -}else{ -break; -} -if (a == 0) break; -} - // Copy the comment { int msiz = ExifLength - (ValuePtr-OffsetBase); if (msiz > ByteCount) msiz = ByteCount; if (msiz > MAX_COMMENT_SIZE-1) msiz = MAX_COMMENT_SIZE-1; -if (msiz > 5 && memcmp(ValuePtr, "ASCII",5) == 0){ -for (a=5;a<10 && a < msiz;a++){ -int c = (ValuePtr)[a]; -if (c != '\0' && c != ' '){ -strncpy(ImageInfo.Comments, (char *)ValuePtr+a, msiz-a); -break; -} -} -}else{ -strncpy(ImageInfo.Comments, (char *)ValuePtr, msiz); -} +strncpy(ImageInfo.Comments, (char *)ValuePtr, msiz); } break