Forum Moderators: coopster
Not sure if this is possible or I am going about this is the correct way?
Code:
<?php
list($width, $height, $type, $attr) = getimagesize("images/makers/16/tn/anthologia-mis16-10.jpg");
echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;
echo "<BR>";
echo "Attribute " .$attr;
?>
what I would like to do is calulate all the image widths for the following recordset so each user would output a different value
for example there is 16 images for mis_id 16 so the total width would be 2080px
the reason I need this value is because I have a image scroller but this requires a width: as each members gallery will be different
<?php
$colname_gallery = "-1";
if (isset($_GET['mis_id'])) {
$colname_gallery = $_GET['mis_id'];
}
mysql_select_db($database_mis, $mis);
$query_gallery = sprintf("SELECT * FROM members_gallery WHERE user_id = %s", GetSQLValueString($colname_gallery, "int"));
$gallery = mysql_query($query_gallery, $mis) or die(mysql_error());
$row_gallery = mysql_fetch_assoc($gallery);
$totalRows_gallery = mysql_num_rows($gallery);
$galleryimage=mysql_result($gallery,$i,"gallery_image");
?>
the width are not yet in the DB if I can insert them into DB when I upload an image that would be fine mayb ejust use hidden field in the form but what do put to get the image width of uploading file?
I could do a sum in the query but how do I get to that stage or is there another way of totaling the image widths in a query without inserting to DB?
all need is to get a figure for $total width for example 16 images would be 2020px
<div id="scroll" style width=$totalwidth">