I'm displaying a group of thumbnails on a Wordpress site using the Magic Fields plugin
Here's the code in my template:
<?php
$client_images = get_group ('images');
foreach($client_images as $image){ ?>
<div class="thumb">
<a href="<?php echo $image['client_image'][2]['original']; ?>">
<?php echo "<img src='".$image['client_image'][3]['thumb']."' />" ;?>
</a>
<div class="tooltip">
<h5>Resolution</h5>
<p>[ORIGINAL RESOLUTION]</p>
<h5>Credit</h5>
<p><?php echo $image['client_image_credit'][4]; ?></p>
<h5>Description</h5>
<p><?php echo $image['client_image_description'][5]; ?></p>
</div>
</div>
<?php }
?>
Where it says [ORIGINAL RESOLUTION], I'd like to print the resolution (e.g. "1200x800") of the source image.
Magic Fields uses phpThumb to generate thumbnails. phpThumb seems to have a function for this purpose:
//Getting the original size of the image
if( preg_match('/'.MF_FILES_NAME.'/',$image_name_clean) ){
$image_name_clean = preg_replace('/'.MF_FILES_NAME.'\//','',$image_name_clean);
$file = MF_FILES_DIR.$image_name_clean;
}else{
$file = WP_CONTENT_DIR.DS.$image_name_clean;
}
if(file_exists($file) && (empty($_GET['w']) || empty($_GET['h']))){
$size = @getimagesize($file);
$default['w'] = $size[0];
$default['h'] = $size[1];
}
Would anyone be able to help me connect the dots? Thanks!