Cannot resize

See all posts Reply

Cannot resize new!
by James, 16 years, 10 months ago
Hi everyone

I have just installed this but having trouble with it reading jpg files. For some reason the class believes that they have a mime type of .gif. I don't want to change their type just change their size. I think this is causing the problem. Here is the error log.

Error in creating GIF image from source.system information
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
- source variables
file_src_name : 1681074-1.jpg
file_src_name_body : 1681074-1
file_src_name_ext : jpg
file_src_pathname : C:\Windows\Temp\php5B0A.tmp
file_src_mime : image/gif
file_src_size : 2201 (max= 2097152)
file_src_error : 0
- source file is an image
image_src_x : 120
image_src_y : 50
image_src_pixels : 6000
image_src_type : gif
image_src_bits : 8
process file to school_logos\
- file size OK
- file mime OK : image/gif
- new file name body : school_logo_648
- file name safe format
- destination variables
file_dst_path : school_logos\
file_dst_name_body : school_logo_648
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : school_logo_648.jpg
file_dst_pathname : school_logos\school_logo_648.jpg
- school_logo_648.jpg doesn't exist already
- image resizing or conversion wanted
Reply
Re: Cannot resize new!
by colin, 16 years, 10 months ago
In fact, the MIME is sent by your browser, to PHP. The class merely reads that information.

Are you sure your image is indeed a JPEG image? Maybe it is a GIF renamed as a JPEG.Reply
Re: Cannot resize new!
by James, 16 years, 10 months ago
I found the problem. I was using $HTTP_POST_FILES['uploadfile'] instead of $HTTP_POST_FILES['uploadfile']['tmp_name']. Changing that made everything work. THanks anywayReply