function get_img_size($loc) {
        # Get the image size of the file.
        # Array returned gets populated with getimagesize() values:
        /* Array (
                [0] => 60
                [1] => 41
                [2] => 2
                [3] => width="60" height="41"
                [bits] => 8
                [channels] => 3
                [mime] => image/jpeg
                [4] => width="60px" height="41px"
                [5] => width: 60px; height: 41px;
                [6] => width: 60px;
                [7] => height: 41px;
        ) */
$spec = getimagesize(rtrim($loc)); // Use rtrim to remove any extra space on end of $loc. $html_wxh = 'width="'.$spec[0].'px" height="'.$spec[1].'px"'; // = index[4] = width="_px" height="_px", for use in XHTML. $css_wxh = 'width: '.$spec[0].'px; height: '.$spec[1].'px;'; // = index[5] = width: _px; height: _px;, for use in CSS. $css_w = 'width: '.$spec[0].'px;'; // = index[6] = width: _px;, for use in CSS. $css_h = 'height: '.$spec[1].'px;'; // = index[7] = height: _px;, for use in CSS.
        
array_push($spec, $html_wxh, $css_wxh, $css_w, $css_h); // Add $html_wxh and $css_wxh to end of $spec array.
        
        return $spec; // Return the X/Y.
}


--
 Wishlist: <http://snipurl.com/vrs9>
   Switch: <http://browsehappy.com/>
     BCC?: <http://snipurl.com/w6f8>
       My: <http://del.icio.us/mhulse>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to