How To Add Image Size Pixels In Gallery ?

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

4 replies · 450 views · started 18 years ago · 1 min read

3 participants
SiLeNce Developer · 138 posts #1

i wan coding the script ..

like world.2wap.org

SiLeNce Developer · 138 posts #3
Get Image By MIME Types !

<?php
$size = getimagesize($filename);
$fp = fopen($filename, "rb");
if ($size && $fp) {
    header("Content-type: {$size['mime']}");
    fpassthru($fp);
    exit;
} else {
    // error
}
?>
Get Image By File

<?php
list($width, $height, $type, $attr) = getimagesize("img/flag.jpg");
echo "<img src=\"img/flag.jpg\" $attr alt=\"getimagesize() example\" />";
?>
Get Image By URL

<?php
$size = getimagesize("http://www.example.com/gifs/logo.gif");

// if the file name has space in it, encode it properly
$size = getimagesize("http://www.example.com/gifs/lo%20go.gif");

?>

I use only

example

$sql = "SELECT id, sex, imgurl FROM ibwf_gallery ORDER BY uid";

$img = $sql[2];

list($width, $height, $type, $attr) = getimagesize("$img");

$imgsize = $attr;

echo "$imgsize";

SiLeNce Developer · 138 posts #5

Now i just edited the coding with

$sql = "SELECT id, sex, imgurl FROM ibwf_gallery ORDER BY uid";

$img = $sql[2];

list($width, $height, $type, $attr) = getimagesize("$img");

$imgsize = "$width x $height pixels";

echo "$imgsize";

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close