It is a thumbnail
Put the file
If there is a picture in the directory, you will automatically generate a small picture.
Suitable for batch generation small maps, doing pictures of the picture station.
PHP $ config = array (); $ config ['Path'] = "./"; $ config ['t_width'] = 120; $ config ['t_height'] = 98; $ config ['ignore'] = Array ("", "." ..); $ config ['prefix'] = "thumb_"; $ done = 0; Define ("image_jpg", 2); define ("endl", "/ N "); if ($ handle = OpenDir ($ config ['Path'])) {while ($ file = readdir ($ hand)) {if (! array_search ($ file, $ config 'Ignore'])) {list ($ IM_WIDTH, $ IM_HEIGHT, $ TYPE) = GetImagesize; if ($ TYPE! = Image_JPG) {Continue;} $ OP. = "Found -> $ file ". Endl; $ = @ImageCreateFromJPEG ($ file); if (! $ =) {$ op. =" fail -> COULDN'T Create Sour Image Pointer. " $ File_Exists ($ config ['prefix']. $ File || Substr ($ file, 0, strlen ($ config ['prefix']) == $ config ['prefix'] ) {$ Op. = "Note -> this file haas already GOT A thumbnail. "Endl; Continue;} $ to = imagecreatetruecolor ($ config ['t_width'], $ config ['t_height']); if (! $ to) {$ OP. =" fail -> COULDN ' Create Dest Image Pointer. "Endl; Continue;} IF (! ImageCopyResample) ($ To, $ IM, 0, 0, 0, 0, $ Config ['T_Width'], $ Config ['