title: How can I apply classes to images based on their aspect ratio with PHP?
body: <p>I'm working on a drupal6 site and I've got a page that shows thumbnail images (linked to full node content).</p>
  
  <p>The images are currently allowed to have a dynamic width based on the parent div, and are both vertical and horizontal.</p>
  
  <p>the problem I'm having is that there is a max-width applied to these images, which crushes my horizontal images.
  the question I have is: how can I use PHP to get the image element which has a unique ID, discover if it is horizontal or vertical and apply a CSS class based on the image's aspects.</p>
  
  <p>I'd need to either put this in my template.php as a pre-process, or in my page.tlp.php.
  I can't use Jquery/javascript because I can't risk the FOUC. I also and developing this site as a multi-site drupal instal per instructions, and I'm not allowed to have anything outside my own site directory folder.</p>
  
  <p>I've looked at getimagesize() and getElementsByTagName() but I'm just not sure how to put it together as my PHP is pretty limited. I'm hoping that someone here can point me in the right direction VS giving my the answer.</p>
  
  <p>Thanks
  Stephanie</p>