Viewing comments with Cygwin's rdjpgcom

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
dsm26
Posts: 1
Joined: Mon Nov 23, 2009 4:48 pm

Viewing comments with Cygwin's rdjpgcom

Post by dsm26 »

Hi,

I'm using XnView 1.96.5. I added comments to some photos and then tried to use Cygwin's rdjpgcom utility to pull them out. All of the comments have a \000 tacked to the end of them when rdjpgcom runs. Is this an issue with rdjpgcom or XnView. I've previously used Exifer for adding comments and rdjpgcom works fine with that. I'm running XnView on Windows XP Sp2.

Thanks,
Don
User avatar
xnview
Author of XnView
Posts: 46273
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Viewing comments with Cygwin's rdjpgcom

Post by xnview »

The comment written with XnView are not readed correctly with rdjpgcom?
Pierre.
Silversleeves
Posts: 95
Joined: Mon Nov 27, 2006 6:12 pm
Location: Nordestlich VSA

Re: Viewing comments with Cygwin's rdjpgcom

Post by Silversleeves »

xnview wrote:The comment written with XnView are not readed correctly with rdjpgcom?
They are, but it takes typing in an option to get them displayed right.

I read a thread on a Debian bug discussion list about this very issue: a backslash and three zeros when read (the "rd" in rdjpgcom stands for read) and nothing superfluous when written (the "w" in wrdjpgcom). This is from rdjpcom's brief help file -- accessed, as it happens, accidentally by me while looking for the "version" number.
rdjpegcom in bash-3.2.4.9(23) for cygwin wrote:rdjpgcom displays any textual comments in a JPEG file.
Usage: rdjpgcom [switches] [inputfile]
Switches (names may be abbreviated):
-raw Display non-printable characters in comments (unsafe)
-verbose Also display dimensions of JPEG image

It's interesting how the maintainer on the Debian bugs list and the current authors of rdjpegcom consider a "clean" comment "unsafe," isn't it?


So if one types in a command like

rdjpgcom -raw xnview_logo.jpg

...which has a comment line such as

XnView is free-of-charge software, available for three platforms.

... the return will be the same as if it were viewed in XnView's Edit menu>Edit comment window, which is how it should be seen.

Hope this helps.

BZT
Silversleeves
Posts: 95
Joined: Mon Nov 27, 2006 6:12 pm
Location: Nordestlich VSA

Shortcut to the "-raw" option possible

Post by Silversleeves »

@dsm26 (and any other Cygwin/Linux rdjpgcom users who might be reading this):

I didn't think of this until just this morning, but a shortcut to the "-raw" option is possible if you add this alias to your .bashrc or .bash_aliases file:

Code: Select all

alias rdjpgcom='rdjpgcom -raw'
I suggest adding it in either one of the command-line editors such as vim or pico, or if you prefer a free Windows text-editor that is, after a simple tweak of the preferences, guaranteed to save files with the right line-endings for Cygwin to use, try Crimson Editor.

The above alias will enable you to type rdjpgcom somefile.jpg and the result will appear without the backslash and three zeros. If it doesn't work as it should right away, use this command:

Code: Select all

source ~/.bashrc
...and try the rdjpgcom command again.

Hope this helps.

BZT
Post Reply