I have a script on my site that displays any image files I add to a certain folder. I use this folder as a depository for any digital art I make. That way I can just save png's from Photoshop or whatever directly to that folder and the will display on the page.
The problem is that the files sizes are too large to be loaded easily, even if they are displaying correctly. The .css class is the image resizer.
Can you resize an image without loading it entirely? I might be understanding this wrong, thanks for your help.
<?php
$dir = "../endlessdescriptionone/images/";
$dh = opendir($dir);
$gallery = array();
while($filename = readdir($dh)) {
$filepath = $dir.$filename;
//pregmatch usedto be ereg
if (is_file($filepath) and preg_match("/\.png$/",$filename)) {
$gallery[] = $filepath;
}
}
sort($gallery);
foreach($gallery as $image) {
echo"<img src='$image' class='resizesmall'>";
}
?>