简体   繁体   中英

Intermittent Re-sizing Image Issue

I'm uploading images via stream_copy_to_stream() and then re-sizing them using the class and method below.

This is my resize class: http://pastebin.com/wtbcbfzv

I'm using it like so.

$resizeObj = new resize('image.jpg');
$resizeObj -> resizeImage(960, 800, 'auto');
$resizeObj -> saveImage('image.jpg', 100);

However it sometimes works and sometimes doesn't, it just fails, no errors returned at all. I have the memory limit successfully set at 150M and have gone up to 300M with no such luck. I've also made sure that max_execution_time is set to 0 so there's no worries there.

Any suggestions on what could be causing this intermittent issue?


UPDATE This is being returned with the only image with the issue and I noticed the height is 6600 and when reduced to ie 5500 it works..

"imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions"

Found out it was an issue with the host, who has a process that kills anything that will use x% of ram as it is a shared server. All resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM