java - How to relate images in a folder to its metadata stored in mysql in perl? -


i able store uploaded image in folder(named category) , related data uploaders info,its category in mysql using code below.

use strict; use warnings; use dbi; use dbd::mysql; use cgi; $query = new cgi; $uploader_name = $query->param("name"); $filename = $query->param("file"); $category = $query->param("cat"); $uploaded_dir = $category; print $query->header(); $filename =~ s/.*[\/\\](.*)/$1/; $filename =~ s/ /_/g; $upload_filehandle = $query->upload("file"); $directory_filename = "$upload_dir/$filename";  # upload file server  open uploadfile, ">$directory_filename"; binmode uploadfile;  while ( <$upload_filehandle> )   {    print uploadfile;   }  close uploadfile;  # open file # open myfile, $directory_filename || print "cannot open file"; # $blob_file;  # read in contents # while (<myfile>)  #  { #   $blob_file .= $_; #  } # close myfile;  # make database connection $dbh=dbi->connect("dbi:mysql:database=pics;host=localhost","?","?"); # set value of sql query $query = "insert pic(uploader_name, category) values (?, ?) ";  $sth = $dbh->prepare($query); $sth->execute($uploader_name, $category) || print "can't access database";  $sth->finish; $dbh->disconnect; 

i need remaining metadata color, title etc of loaded images.how can done? heard of metadata extractors(in java) this.how work. suggest best of them. how relate image respective metadata retrieval?

just make "filename" column in db table, , can find rest of data file name.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -