function ProcessImageName($imagename) { global $imagelist, $imagelistfull; global $imagecount; GetImagePaths($imagename, $fullpath, $thumbpath); $size = GlassyImageSize($fullpath, $imagename); if ($size[0] && $size[1] && ($size[2] == 99 || $size[2] < 4)) { $fileroot = explode('.', basename($imagename)); EnsureThumbnail($imagename, $size, THUMBSIZE); if (strcmp($fileroot[0], "null")) { $imagelist[$imagecount] = $imagename; $imagelistfull[$imagecount] = $thumbpath; $imagecount++; } } }
<tr><td colspan="6"> <hr /> </td></tr> <!-- row 9 --> <tr> <!-- column 1 --> <td class="formdesc"> button image </td> <td class="formedit"> <input class="text" type="text" name="imgname" tabindex="15" value="<?php echo $image_name; ?> " /> <?php GetImagePaths($image_name, $fullpath, $thumbpath); ?> <a href="javascript:imagePicker()"><img alt="select a background button image" id="imagesrc" src="<?php echo $thumbpath; ?> "></a> <a href="javascript:popUp('image')"><img src='question.png' alt='information about this item' /></a> </td> <td class="sminfo"> </td> <!-- column 2 --> <td class="formdesc"> upload image </td> <td class="formedit"> <input class=file type="file" name="userimage" tabindex="16" />
function EnsureThumbnail($name, $size, $thumbdim) { $image = "invalid"; GetImagePaths(basename($name), $fullpath, $thumbpath); if (!file_exists($thumbpath) || @filectime($name) > @filectime($thumbpath)) { $execarg = IMCONVERT . " -resize {$thumbdim}" . "x{$thumbdim} {$fullpath} {$thumbpath}"; @exec($execarg); } }