jhead problem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

jhead problem

jdd@dodin.org
hello,

I have a problem, for some time now. It's seen in jhead.

I have a script to extract comments from jpg files. the comments are
inserted automatically by digikam.

I extract them with:
jhead -cs temp img_5734.jpg (for example)

for a given file I get (hexdump -c):

0000000   c   o   n   n   e   c   t   e   u   r       d   i   s   q   u
0000010   e       d   u   r       s   u   p   p   l 303 251   m   e   n
0000020   t   a   i   r   e  \0  \0
0000027

you see the \0 \0 at the end.

it's this, the problem.

why are these null chars inserted? (seen as ^@^@ in vi)

how can I remove them?

openSUSE 11, full updated, but I have the same problem with 10.3, so
iut's not new.

thanks
jdd
--
http://www.dodin.net
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: jhead problem

jdd@dodin.org
jdd a écrit :
> hello,
>
> I have a problem, for some time now. It's seen in jhead.

seen with jhead, but not from jhead, if I edit the file with jhead
-ce, there is no problem

jdd


--
http://www.dodin.net
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: jhead problem

Gilles Caulier-4
The comment inserted by digiKam is performed in background by Exiv2
library. Ask into Exiv2 mailing list why this problem appear.

Best

Gilles Caulier

2008/7/19, jdd <[hidden email]>:

> jdd a écrit :
>> hello,
>>
>> I have a problem, for some time now. It's seen in jhead.
>
> seen with jhead, but not from jhead, if I edit the file with jhead
> -ce, there is no problem
>
> jdd
>
>
> --
> http://www.dodin.net
> _______________________________________________
> Digikam-users mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-users
>
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: jhead problem

jdd@dodin.org
Gilles Caulier a écrit :
> The comment inserted by digiKam is performed in background by Exiv2
> library. Ask into Exiv2 mailing list why this problem appear.

ok
thanks
jdd


--
http://www.dodin.net
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: jhead problem

Gilles Caulier-4
Note than digiKAm use libkexiv2 interface to play with Exiv2 library.
To set a comment, digiKam pass the strings as well to libkexiv2. This
last one format the string using this code :

http://lxr.kde.org/source/extragear/libs/libkexiv2/libkexiv2/kexiv2.cpp?v=3.5-branch#270

Like you can see, there is nothing special here. The QString content
is just converted in C++ String as well and this one is passed to
Exiv2 library. All the rest, epecially the way to record the data in
jpg is performed by Exiv2.

Best

Gilles Caulier

2008/7/19, jdd <[hidden email]>:

> Gilles Caulier a écrit :
>> The comment inserted by digiKam is performed in background by Exiv2
>> library. Ask into Exiv2 mailing list why this problem appear.
>
> ok
> thanks
> jdd
>
>
> --
> http://www.dodin.net
> _______________________________________________
> Digikam-users mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-users
>
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: jhead problem

jdd@dodin.org
Gilles Caulier a écrit :
> Note than digiKAm use libkexiv2 interface to play with Exiv2 library.

thanks, I posted your note to the exiv2 list (yahoo - Grrrrrrrrr)

but I also see there is a standalone exiv2 app, I will try this
thanks
jdd
--
http://www.dodin.net
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: jhead problem

jdd@dodin.org
In reply to this post by Gilles Caulier-4
I'm puzzeld..

the file content is (hexdump -c):

0000530 320 377  \0  \0  \0  \0  \0  \0   0  \0  \0  \0  \0  \0   A  S
0000540   C   I   I  \0  \0  \0   I   l       r   e   s   t   e      d
0000550   e       l   a       p   l   a   c   e       p   o   u   r
0000560   l   a       r   a   m  \0   @ 037  \0 320  \0  \0  \0  \0  p
0000570 027  \0 234  \0  \0  \0  \0  \b  \0  \0  \0  \b  \0  \0 004 \0
00

see the \0 after "ram"


jhead -ce <file> (->vi)
Il reste de la place pour la ram^@^@

and jhead -cs temp <file> gives

jdd@linux-0hk5:~/temp/20080716> hexdump temp
0000000 6c49 7220 7365 6574 6420 2065 616c 7020
0000010 616c 6563 7020 756f 2072 616c 7220 6d61
0000020 0000
0000022

(same result, may be noted y system is utf8)

but exiv2 -ph <file> > ex.txt gives

0x9286 Photo        UserComment                 Undefined  40  40
   0000  41 53 43 49 49 00 00 00 49 6c 20 72 65 73 74 65  ASCII...Il reste
   0010  20 64 65 20 6c 61 20 70 6c 61 63 65 20 70 6f 75   de la place pou
   0020  72 20 6c 61 20 72 61 6d                          r la ram

0xa000 Photo        FlashpixVersion             Undefined   4   4

and exiv2 file gives
Commentaire Exif: Il reste de la place pour la ram

after removing the null with jhead:

0x9286 Photo        UserComment                 Undefined  40  40
   0000  41 53 43 49 49 00 00 00 49 6c 20 72 65 73 74 65  ASCII...Il reste
   0010  20 64 65 20 6c 61 20 70 6c 61 63 65 20 70 6f 75   de la place pou
   0020  72 20 6c 61 20 72 61 6d                          r la ram

0xa000 Photo        FlashpixVersion             Undefined   4   4
   0000  30 31 30 30

exact same result

jdd
--
http://www.dodin.net

_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users