jwhite68 Posted February 5, 2008 Share Posted February 5, 2008 My existing code has the following function, which uses some form of 'convert' function to create a thumbnail file. However, its not working on the web server - even though it used to. I have inherited this code, and do not know the background behind it. Does anyone recognise it, or know what this 'convert' function is? See 'this line' marker below. I cannot see any PHP function called convert, and assume its some library that needs to be compiled into PHP, or maybe referencing a PERL function? function resizeByWidth($input,$output,$width,$onlyIfBigger=true){ /* Description : Resizes regular image by given height Parameters : input : path to the file output :path to output file height :the new height onlyIfBigge : wheather to resize if image height is smaller then new height Returns : true : if success false : if file not exists or not a regular image */ if($pic_info = checkImage($input)){ if($pic_info[1]<$width && $onlyIfBigger){ copy($input,$output); echo'File copy'; return false; } $proportions = $width/$pic_info[1]; $newHeight = round($pic_info[2] * $proportions); $cmd = 'convert '.$input.' -thumbnail '.$width.'x'.$newHeight.' '.$output; <--- this line $res = `$cmd`; echo $res; } else{ return false; } } Link to comment https://forums.phpfreaks.com/topic/89540-creating-thumbnail-images-used-to-work-now-doesnt-work/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.