Stories
Slash Boxes
Comments

Slash Open Source Project

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • by james (1612) on Tuesday March 11 2003, @03:02PM (#5872) Homepage Journal
    Question about image blobs. (Not having yet looked at the code, sorry.)

    I have programmed a ridiculously complicated plugin for internal (my wife and I) use that manages family pics (8,000 and climbing), generating a static webisite of selected images for external consumption. Anyway, one problem I've had is detecting duplicate images. I've tried to resolve this by using dates to subdir the images in the image file system, but if there is a name collision (same datestamp + same filename), I just ignore the new image.

    The usual case is when I forget to purge all uploaded images from my memorystick. But there are situations where the same date and the same imagenumber/filename can be generated by my camera, but for different images---say if I clear out the memorystick and then shoot some more pics the same day.

    Now my question. Since I think it was said that this new image capability was programmed with blobs, can one compare two blobs to confirm that an incoming image and a stored image that resolve to the same "name" are indeed the same, thus necessitating an incremental bump in the image name rather than just ignoring it? I haven't used blobs. I understood that blobs are pretty inefficient to search on in MySQL, as are text values. But this isn't a search so much as a "fetch with key, compare blob" operation. I was thinking about doing some sort of MD5 comparison, but if blob compares work and are fast, I can perhaps go that route.

    james
    • The Blob system will never save an image or a file twice, it just increments a reference counter. If you call delete, the file/image is not deleted until the reference count reaches zero.

      So if you used Slash::Blob you would never have to worry about duplicates.
      --

      --
      You can't grep a dead tree.