Hi,
I've been using vgrabbj for a while now, and I love
it. I have a
very slick live webcam setup with it [1].
I am trying to get an image archive of the last 10
images, with no
/tmp writing ('UseTmpOut Off' in the config file).
The problem is that since I'm not writing a tmp file
first, vgrabbj
writes directly to picture.jpg, overwriting whatever
was earlier in
it. Then, the archive code (in v_writer.c)
makes a link of
picture.jpg again. This makes all the archive images
have the same
inode as the current picture.jpg, and so there is only
one image, even
though there are a lot of filenames. I suppose
this happens only
UseTmpOut=Off.
Also, since the archive location can be on a
different filesystem
from the image location, a link() might not work.
link() only works
for source and destination on the same filesystem.
An easy fix is to copy the file instead of linking
it. The code
modification is minimal, involving just one new
function. I have
included the context diff, which can be incorporated
with the patch
program, or by hand. I would appreciate if you
include it in the
original vgrabbj distribution. The patch license is GPL.
I'm sorry if I haven't been able to explain
it nicely. My
programming is usually better than my English. Do mail
me if there is
any confusion.
Thanks for a lovely program!
Vikram
1. Live webcam with vgrabbj:
http://mayin.org/aragorn/computers/webcam.html
Context diff against 0.9.6
Patch applied in revision 215.
https://sourceforge.net/p/vgrabbj/code-svn/215/
Thanks for your patience.
Diff: