PHP Thumbnail Script Change. Very Small $15.00

My website allows a person to upload a photo. When they upload it, sometimes it uploads in upper case and the resulting file has the file extension .JPG My thumbnail script will not show this file as a thumbnail. If I change the file to lower case it appears correctly. I realize this can be corrected by changing the main upload script, but I have thousands of photos with the upper case file extension.

Below is my thumbnail code. If you can add a line of code to make it show the images with the upper case .JPG extension, I will send you $15.00 right away. The fix MUST work before we complete the project. Please be fast and honest. I have a good rating and you should too.


$local_file = "/www/html/thumbs/$pic";

if (!file_exists($local_file))

$local_file = "$upload_home/[url removed, login to view]";

if( ereg( "gif$", $pic ) ) { $base = ImageCreateFromGIF($local_file); }

else if( ereg( "png$", $pic ) ) { $base = ImageCreateFromPNG($local_file); }

else if( ereg( "jpe?g$", $pic ) ) { $base = ImageCreateFromJPEG($local_file); }

else if( ereg( "JPE?G$", $pic ) ) { $base = ImageCreateFromJPEG($local_file); }

$bsize = GetImageSize($local_file);

$thumb = @ImageCreateTrueColor(200, 145);

ImageCopyResized($thumb, $base, 0, 0, 0, 0, 200, 145, $bsize[0], $bsize[1]);

if( function_exists( ImageGIF) ) {

header( "Content-type: image/gif\n\n" );



else if( function_exists( ImagePNG) ) {

header( "Content-type: image/x-png\n\n" );



else {

echo "Unsupported imageformat.";





Evner: PHP

Se mere: thumbnail, rating script, photo change, show image thumbnail php, thousands php project, image thumbs, thumbs image, php thumbnail, php header script, unsupported, html file upload content type, png php, away website php, small thumbnail photo, php upload file extension, php upload photo code, thumbnail photo, small thumbnail, php script echo, php rating thumbs script

Om arbejdsgiveren:
( 15 bedømmelser ) Cincinnati, United States

Projekt ID: #1657019