1.44 build 178

Please rate DAlbum at HotScripts.com
Please rate DAlbum at @ PHP-Resource.de
Rate DAlbum @ The PHP Resource Index
Script Rating:
Display EXIF info line   

The purpose of this sample is add a line with EXIF parameters (time, ISO, exposition time etc.) to the image page that will be displayed when "Show Details" mode is off.

Please check demo for an example.


1. Edit your t_showimg.php page template and insert the following code in position where you want EXIF info to be diplayed.

<div style="font-size:8pt;white-space:nowrap;text-align:center;">
    <?    include(DALBUM_ROOT . "/config/exifline.php"); ?>

For example, to add it right below the image, insert it after image closing tag:

<td >
    <a href="<?php template('ImageHref');?>">
    <img id="Image"
         src="<?php template('ImageSrc');?>"
         title="<?php template('ImageAlt');?>"
         <?php template('ImageWidthHeight'); ?>

<div style="font-size:8pt;white-space:nowrap;text-align:center;">
    <?    include(DALBUM_ROOT . "/config/exifline.php"); ?>


2. Create a file called exifline.php in ./config directory containing the following script (you can download the script from exifline.zip):

// This module reads and prints exif details from current image
// if image details bar is not displayed (by Show Details button).
// Feel free to add, remove and rearrange parameters.
if ($image->IsImage() && // This will protect against direct include
    !($bShowDetails && $g_bShowEXIFDetailsButton))
    // Read EXIF
    if ($g_bForceDAlbumEXIFCode || !extension_loaded('exif'))
        require_once(DALBUM_ROOT  . "/include/exif.php");

    if ($exif===false)


    // Resolution
    if ($image->m_nX>0 && $image->m_nY>0)

    // Date/time
    if (isset($exif['DateTimeOriginal']))
    if (empty($date) && isset($exif['DateTime']))

    if (!empty($date))
        $date=split(':',str_replace(' ',':',$date));
        $date="{$date[0]}-{$date[1]}-{$date[2]} {$date[3]}:{$date[4]}:{$date[5]}";

    // ISO speed

    if (isset($exif['ISOSpeedRatings']))
    else if (isset($exif['MakerNote']) && isset($exif['ModeArray']))
        // Add ISO for PowerShot cameras
        switch (@$exif['ModeArray'][16])
            case 15: $iso="auto";break;
            case 16: $iso="50";break;
            case 17: $iso="100";break;
            case 18: $iso="200";break;
            case 19: $iso="400";break;

    if (!empty($iso))

    // Exposure
    if (isset($exif['ExposureTime']))
        if ($d1>0 && $d2>0)
        if ($e<1 && $e>0)
            $e="1/" . round(1/$e,0) . " s";
            $e=round($e,1) ." s";


    // Aperture
    if (isset($exif['COMPUTED']['ApertureFNumber']))

    // Flash
    if (isset($exif['Flash']))

    // Combine all together into one line
    if (!empty($data))
        foreach ($data as $d)
            if (!empty($sExifDetails))
                $sExifDetails.="; ";

    // print the line
    print $sExifDetails;

3. Enjoy!