socrtwo has asked for the wisdom of the Perl Monks concerning the following question:

I am working on an open source French and Chinese stamp image ID system based on the Image::Seek module, eUpload script, makedb.pl, and seek.cgi. Every new uploaded image sent to stamp-eye-d.cgi invokes the newimg2db.pl script which creates a redirect header by calling and parsing the results from my version of makedb.pl.

The system sort of works now, at least for uploaded images of French and Chinese stamps in BMP format, but the image displayed and parsed for image similarity is the previously uploaded image. Additionally if I upload from the web service form the database image key number gets stuck on say 3361 and does not increment.

If I upload an image via FTP instead of from the web page form, and then run makedb.pl from Jail Shell within the cgi-bin, it correctly increments. If I look in the imgname.db in Notepad++, there are several images associated with each stuck database key.

Any suggestions for reasons these two things are occurring and ways to fix them? There are 12 BMP images here to test with.

Thanks for the help.

  • Comment on Image::Seek Database Stuck on Key Number

Replies are listed 'Best First'.
Re: Image::Seek Database Stuck on Key Number
by pileofrogs (Priest) on Aug 05, 2009 at 17:14 UTC

    That's way too much for me to wade through. Maybe there's someone who's an expert on your exact problem and can answer your question, but until they do, you might want to try reducing your problem to a very simple script. By that I mean, make the shortest script you can that demonstrates your problem. Then you'll either (a) solve the problem yourself or (b) have an easier time finding help here.

    --Pileofrogs

      I think I might have an answer, from http://search.cpan.org/~simon/Image-Seek-0.01/lib/Image/Seek.pm:

      cleardb

      "Clears the internal database. Note that loaddb will load into memory a bunch of data that you may already have - it will duplicate rather than replace this data, so results will be skewed if you load a database multiple times without clearing it in between."

      Update

      The results are somewhat promising, but I'm going to start from scratch and rebuild the database.

      Update

      Putting the cleandb command in the file before the loaddb command and telling the module to export the function sort of works but it causes the database keys to count down instead of iterate up. I also tried putting it after loaddb, but that seems to result in a hung makedb.pl file and no redirection.

      Anybody have any ideas on how to use cleandb correctly?