Note that there are some explanatory texts on larger screens.

plurals
  1. POGet size of an image from database
    primarykey
    data
    text
    <p>i have a simple tag based image gallery which saves all images in a database. To show these images there is a small php script</p> <pre><code>&lt;?php include_once("config/config.php"); $mysql_user = USER; $password = PWD; $database_host = HOST; $database = DB; mysql_connect($database_host, $mysql_user, $password) or die ("Unable to connect to DB server. Error: ".mysql_error()); mysql_select_db($database); header('Content-type: image/jpeg'); $query = "SELECT imgblob from images where id=". intval($_GET["id"]); $rs = mysql_fetch_array(mysql_query($query)); //echo mysql_error(); echo base64_decode($rs["imgblob"]); ?&gt; </code></pre> <p>After a search there is a list of images that looks like </p> <pre><code>&lt;a class="lightbox" href="showimage.php?id=1" title="" &gt;&lt;img src="showimage.php?id=1" /&gt;&lt;/a&gt; </code></pre> <p>I use lightbox to resize the image on click. So i need to get the size of the image source (showimage.php?id=1).</p> <p>I have the following code snippet</p> <pre><code> $('a.lightbox').each(function() { var img = $(this).children("img"); var theImage = new Image(); theImage.src = img.attr("src"); $(this).fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'speedIn' : 600, 'speedOut' : 200, 'overlayShow' : false, 'type' : 'iframe', 'width' : theImage.width + 20, 'height' : theImage.height + 20 }); }); </code></pre> <p>These function doesn't work all time. Often the resize image is very small. I don't have any idea to fix it.</p> <p>Here is a sample gallery <a href="http://www.phyxius.de/projects/phx.imga/" rel="nofollow">www.phyxius.de/projects/phx.imga/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload