load_from_database( substr($filename,0,-4) ); elseif ( file_exists($filename) || is_remote_file($filename) ) $image->load_from_file($filename); else send_to_log(1,'Unable to process image specified : '.$filename); // Optimisation: If a rotate needs to be done, swap the X/Y sizes over if (get_sys_pref('IMAGE_ROTATE','YES')!='NO' && $image->rotate_by_exif_changes_aspect()) list($x,$y) = array($y,$x); // Resize it to the required size, whilst maintaining the correct aspect ratio $image->resize($x, $y, 0, $aspect, $rs_mode); // Rotate/mirror the image as specified in the EXIF data (and enabled) if (get_sys_pref('IMAGE_ROTATE','YES')!='NO') $image->rotate_by_exif(); // Overlay image if ( !empty($overname) ) { $overlay = new CImage(); $overlay->load_from_file($overname); if ($overlay->image !== false) { $overlay->resize( $ow, $oh, 0, true, $rs_mode); $image->copy($overlay, $ox, $oy); } } // Output the image to the browser. if (isset($_REQUEST["type"])) $image->output($_REQUEST["type"]); else $image->output('png'); } /************************************************************************************************** End of file **************************************************************************************************/ ?>