Additional fields

Phoca Gallery - image gallery extension
mldp
Phoca Member
Phoca Member
Posts: 16
Joined: 19 Mar 2008, 12:59
Location: Austria

Hello,first of

Post by mldp »

Hello,
first of all congratulation for this application.

Problem:
I want to store also keywords and exif infos for the pictures into the DB and show it like the description in the detail view.

Questions:
a) Is it possible to insert new fields into the DB
b) How can I put the new fields into the backend data input form(s)?
c) Where do I have to change it for the view in the frontend?
d) Where do I have to do the change for the search. I also want to search in the new fields (f.e. keywords)?

Thanks for your help
Markus
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

there is a descripti

Post by Jan »

there is a description field
a) if you know php and sql - no problems
b) into a view.html.php and default.php of a form (phocagallery view) and the models and controllers for the view - you must know the joomla framework and MVC pattern
c) the same - view.html.php and default.php for (category, categories or detail view) and the models and controllers of these views
d) in the phoca gallery search plugin:
https://www.phoca.cz/phocagallery-search-plugin/

Jan
If you find Phoca extensions useful, please support the project
mldp
Phoca Member
Phoca Member
Posts: 16
Joined: 19 Mar 2008, 12:59
Location: Austria

Hello Jan,

Post by mldp »

Hello Jan,

thank zou very much for this very fast answer. I will dry the ways you told me. Let me see if I´m successful.

Best regards
Markus
the-pipster
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 Jul 2008, 18:22

Re: Additional fields

Post by the-pipster »

Hi Markus,

Any advancement on this? I am developing an amateur photographers site and displaying the EXIF info in the description field would be really useful. RSGallery2 does this but its in a tabbed pane and it has z-index problems when the lightbox is used. I tried looking at the EXIF php file but its a bit too complicated for amateur like me :shock:

Philip
the-pipster
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 Jul 2008, 18:22

Re: Additional fields

Post by the-pipster »

Hi,

I have been looking at php scripts to extract EXIF data. I found the following script

<?php
function ex($param){
$exif = exif_read_data($param, 0, true);
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
if($name == 'ExposureTime'){
echo "<h2>Exposure Time:</h2>";
echo "<h3> $val sec</h3>";
}
if($name == 'FNumber'){
list($pt1, $pt2) = split('[/.-]', $val);
$fstop=$pt1/$pt2;
echo "<h2>F-Stop:</h2>";
echo "<h3>$fstop</h3>";
}
if($name =='ISOSpeedRatings'){
echo "<h2>ISO:</h2>";
echo "<h3> $val</h3>";
}
if($name =='FocalLength'){
list($pt1, $pt2) = split('[/.-]', $val);
$focal=$pt1/$pt2;
echo "<h2>Focal Length:</h2>";
echo "<h3> $focal</h3>";
}
if($name =='Make'){
echo "<h1>Camera:</h1>";
echo "<p>$val</p>";
}

}
}
}
?>



Also the following variables


$pathfile is the path and filename of the photograph you want the information from.


$exif = read_exif_data($pathfile, 0, true);
$filename = strtolower($exif['FILE']['FileName']);
$filedatename = $exif['FILE']['FileDateTime'];
$filesize = $exif['FILE']['FileSize'];
$filetype = $exif['FILE']['FileType'];
$mimetype = $exif['FILE']['MimeType'];
$height = $exif['COMPUTED']['Height'];
$width = $exif['COMPUTED']['Width'];
$iscolor = $exif['COMPUTED']['IsColor'];
$fstop = $exif['COMPUTED']['ApertureFNumber'];
$imagewidth = $exif['IFD0']['ImageWidth'];
$imagelength = $exif['IFD0']['ImageLength'];
$compression = $exif['IFD0']['Compression'];
$make = $exif['IFD0']['Make'];
$model = str_replace($make,'',$exif['IFD0']['Model']);
$orientation = $exif['IFD0']['Orientation'];
$xresolution = $exif['IFD0']['XResolution'];
$yresolution = $exif['IFD0']['YResolution'];
$resolutionunit = $exif['IFD0']['ResolutionUnit'];
$datetime = $exif['IFD0']['DateTime'];
$exposure = $exif['EXIF']['ExposureTime'].' sec';
$fnumber = $exif['EXIF']['FNumber'];
$exposureprogram = $exif['EXIF']['ExposureProgram'];
$iso = $exif['EXIF']['ISOSpeedRatings'];
$exifversion = $exif['EXIF']['ExifVersion'];
$datetimeoriginal = $exif['EXIF']['DateTimeOriginal'];
$exposurebias = $exif['EXIF']['ExposureBiasValue'];
$meteringmode = $exif['EXIF']['MeteringMode'];
$flash = $exif['EXIF']['Flash'];
$exifimagewidth = $exif['EXIF']['ExifImageWidth'];
$exifimagelength = $exif['EXIF']['ExifImageLength'];
$exposuremode = $exif['EXIF']['ExposureMode'];
$whitebalance = $exif['EXIF']['WhiteBalance'];
$imagetype = $exif['MAKERNOTE']['ImageType'];
$ownername = $exif['MAKERNOTE']['OwnerName'];
$cameraserial = $exif['MAKERNOTE']['Camera'];
$lens = $exif['MAKERNOTE']['UndefinedTag:0x0095'];
$focallength = intval($exif['EXIF']['FocalLength']).' mm';
$copyright = $exif['COMPUTED']['Copyright'];
$yy = substr($datetimeo,0,4);
$mm = substr($datetimeo,5,2);
$dd = substr($datetimeo,8,2);
$h = substr($datetimeo,11,2);
$m = substr($datetimeo,14,2);
$s = substr($datetimeo,17,2);
$tt = "am";
if($h>=13) {$h=$h-12; $tt="pm"; }
$date = $dd.'/'.$mm.'/'.$yy;
$time = $h.':'.$m.':'.$s.' '.$tt;


Just need to find out where to put php script, how to point it at the description field and how to add the fields into the database.

Any help would be greatly appreciated

Philip


Last bumped by mldp on 30 Sep 2009, 08:52.
Post Reply