MAMP, resize not working, works on remote server

See all posts Reply

MAMP, resize not working, works on remote server new!
by Nero, 11 years, 7 months ago
Hi, first of all i love this class! terrific work!

I use MAMP on a mac for testing, i'm running PHP 5.4.10.

I'm unable to upload an image in my MAMP server if I set image_resize to true, if i don't it will move the image to the correct directory, when image_resize is true it will just die without showing the log or errors

here's the log i get when i move the image without resizing, as i mentioned if i use resize it will not show the log at all and any other code below "process()" wont run.

Also i've tried this on my remote server thru godaddy and it works like a charm, it's just on my local server that it dies and the GD library is enabled

system information
- class version : 0.32dev
- operating system : Darwin
- PHP version : 5.4.10
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 32M (33554432 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
MAGIC path will not be used
MIME type detected as image/jpeg; charset=binary by Fileinfo PECL extension
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : photo.JPG
file_src_name_body : photo
file_src_name_ext : jpg
file_src_pathname : /Applications/MAMP/tmp/php/php0HdEje
file_src_mime : image/jpeg
file_src_size : 1893054 (max= 33554432)
file_src_error : 0
- source file is an image
image_src_x : 3264
image_src_y : 2448
image_src_pixels : 7990272
image_src_type : jpg
image_src_bits : 8
process file to upload/
- file size OK
- file mime OK : image/jpeg
- new file name body : b637b19ada1a6ad8a9f7344080b40dd6
- file name safe format
- destination variables
file_dst_path : upload/
file_dst_name_body : b637b19ada1a6ad8a9f7344080b40dd6
file_dst_name_ext : jpg
- checking for auto_rename
- destination file details
file_dst_name : b637b19ada1a6ad8a9f7344080b40dd6.jpg
file_dst_pathname : upload/b637b19ada1a6ad8a9f7344080b40dd6.jpg
- b637b19ada1a6ad8a9f7344080b40dd6.jpg doesn't exist already
- no image processing wanted
- process OK
Reply
Re: MAMP, resize not working, works on remote server new!
by Nero, 11 years, 7 months ago
i forgot to add my php code, i'm using your latest version, i put the image resize inside a comment because otherwise it won't work

if (isset($_POST['submit'])){
  $img_name = md5(date("Y-m-d H:i:s").$_FILES['image']['name']);
  $upload = new upload($_FILES['image']);
  $upload->file_new_name_body 	=	$img_name;
  /*
  $upload->image_resize 			=	true;
  $upload->image_convert			=	'jpg';
  $upload->image_ratio_y			=	true;
  $upload->image_x				=	700;
  */
  $upload->process('upload/');
  echo $upload->error;
  echo $upload->log;
}
Reply
Re: MAMP, resize not working, works on remote server new!
by Nero, 11 years, 7 months ago
After more testing i've found out that the resizing works BUT it will not work on images that are more that 2,500px in either height or width, even if tho the files are under 200kb, any files below that will work find it's just files above that that will not work.

Any suggestions? Thanks!Reply
Re: MAMP, resize not working, works on remote server new!
by colin, 11 years, 7 months ago
You are probably running out of memory. What is important is not the size in KB, but the image dimensions, as the picture gets deflated into memory, and each pixel takes space.

See this post for more details.Reply