Page 1 of 1

Viewing comments with Cygwin's rdjpgcom

Posted: Mon Nov 23, 2009 5:06 pm
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

Re: Viewing comments with Cygwin's rdjpgcom

Posted: Tue Nov 24, 2009 7:48 am
by xnview
The comment written with XnView are not readed correctly with rdjpgcom?

Re: Viewing comments with Cygwin's rdjpgcom

Posted: Sun Jan 24, 2010 5:30 am
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

Shortcut to the "-raw" option possible

Posted: Sat Jan 30, 2010 8:15 pm
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