Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Topic closed
I have a web thing I'm working on and I need to resize all images that show up on the page to 1/4 or a 1/2 of their actual size.
If this code could be incorporated into this, that'd be great:
<?php
$files = glob("../x/*.*");
for ($i=1; $i<count($files); $i++) {
$image = $files[$i];
$supported_file = array(
'gif',
'jpg',
'jpeg',
'png'
);
$ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
if (in_array($ext, $supported_file)) {
echo '<img src="'.$image .'" style="" alt="x" />'."";
} else {
continue;
}
}
?>
Offline
not really sure but couldnt you use html to do this? <img src="topkek.png" style="width:50%; height:50%;"/>
if you can read this....good for you
Offline
not really sure but couldnt you use html to do this? <img src="topkek.png" style="width:50%; height:50%;"/>
The image shows up a little messed up when i do it like that The image looks stretched.
Offline
You know what, wow, I just needed to do <img src="image.png" style="width: 32px; height: auto;" />
I feel kinda stupid now.
Offline
haha good job, keep focussing on your stuff
if you can read this....good for you
Offline
ewoke wrote:not really sure but couldnt you use html to do this? <img src="topkek.png" style="width:50%; height:50%;"/>
The image shows up a little messed up when i do it like that
The image looks stretched.
Side note: that's because CSS width and height aren't relative to the "natural" width and height of the element it's attached to, it's relative to the containing element's width and height.
"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto
Offline
Pages: 1
Topic closed
[ Started around 1738988654.4782 - Generated in 0.039 seconds, 14 queries executed - Memory usage: 1.42 MiB (Peak: 1.53 MiB) ]