exifreader An EXIF data reader for JPEG and TIFF images.

  1. Documentation
  2. Change Log

This extentsion allows you ti read EXIF data (including thumbnails) from your JPEG and TIFF images.

Resources

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions
Usage

See the following code example:

Yii::import('application.extensions.exifreader.CExifReader');

or add to your config:

'components'=>array(
	'CExifReader' => array(
	    'class'=>'ext.exifreader.CExifReader',
	),
),

and then in your Controller or View write:

$exifReader = new CExifReader;
// or $exifReader = Yii::app()->CExifReader;

$exifReader->file = PATH_TO_YOUR_FILE;
$data = $exifReader->getExifData(array(
	// first parameter is tag which we want to get
	// second is which section from it we want to ignore
	array('FILE', array('SectionsFound')),
	'COMPUTED',
	'THUMBNAIL',
	array('IFD0', array('UndefinedTag:0xC4A5')),
	array('EXIF', array('MakerNote')),
));
$thumbnail = $exifReader->getExifThumbnail();

and then you can display result for data:

if (is_array($data) && !empty($data)) {

    echo '<table>';
    foreach ($data as $item) {
        if (!empty($item)) {
            foreach ($item as $key => $value) {
                echo '<tr><td><strong>'.$key.'</strong></td><td>'.$value.'</td></tr>';
            }
        }
    }
    echo '</table>';

}

and for thumbnail:

echo '<img width="'.$thumbnail['width'].'" height="'.$thumbnail['height'].'" src="data:'
.image_type_to_mime_type($thumbnail['type']).';base64,'.base64_encode($thumbnail['thumb']).'">';

enjoy!

Change Log

January 29, 2010
  • Initial beta release.
2 0
3 followers
671 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Tags:
Developed by: ujovlado
Created on: Jan 29, 2010
Last updated: 14 years ago

Downloads

show all