Skip to contents

Computes perceptual hash of uploaded image and checks against existing artworks in the platform database. Prevents re-uploading the same artwork under different names. Uses {artpixeltrace} for hash computation.

Usage

image_hash_exists(fp)

Arguments

fp

Character scalar. File path to image file for hash computation.

Value

Logical scalar. `TRUE` if hash exists in `app.artwork_hash` table (artwork is a duplicate), `FALSE` otherwise (artwork is unique).

See also

* [artpixeltrace::image_phash()] for hash computation * [run_pipeline()] which uses this for deduplication * [modUploadServer()] upload workflow integration

Other utilities: utilities

Examples

if (FALSE) { # \dontrun{
# In upload workflow before pipeline
if (image_hash_exists(input$image_file$datapath)) {
  shiny::showNotification("This artwork already exists", type = "error")
  return()
}
} # }