Get dimensions of referenced image (Magic Fields fields plugin with phpThumb)

I have worked many times with timthumb, but I do not know magic fields, and I am sorry, but i fail to understand a few things :

  1. you want to put a FULL resolution inside a tooltip ?
  2. does thispart of your code $image['client_image'][2]['original']; from above works ?
  3. if it does, there is no reason it should not work in the other div .

anyhow , you can pass parameters to timthumb directly for example like so :

define the variable with a URL

$thumb_for_tim = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ) ; // or in your case - your custom field value - if it returns a URL

and then call it

<img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $thumb_for_tim; ?>&amp;h=155&amp;w=180&amp;zc=1&amp;f=2" alt="<?php the_title(); ?>" h & w are the height and width ..

EDIT ok, after your comment it is more clear . at first when you wrote “[ORIGINAL RESOLUTION]” I thought you wanted the image itself.
in that case the answer is much simpler . PHP has a special function for that .

getimagesize()

$size = getimagesize($filename);

so just point the URL of the image to $filename;

FYI – wordpress itself has a function to get imagesize , it is called

wp_get_attachment_image_src

use like so :

$image_attributes = wp_get_attachment_image_src( $attachment->ID,full ); 

it will returns an array

  • [0] => url

  • 1 => width

  • [2] => height

    so echo $image_attributes[1]; will give you width, and $image_attributes[2] will give you height…