2012-10-11 3 views
1

저는 PHP로 갤러리를 만들고 있습니다. EasyPhpThumbnail을 내 프로젝트에 통합하기로 결정했습니다.EasyPhpThumbnail 동적 자르기

내가 가지고있는 문제는 설정되어 있습니다.

일부 사용자는 이전에이 클래스를 사용했고 경험을 공유 할 수 있습니다. 다른 반원들과 어떤 제안이라도 있으면 기꺼이 들려 줄 것입니다.

업로드 된 이미지를 동적으로 잘라 내기를 원합니다. 축소판의 크기를 특정 너비와 높이로 설정하고 싶습니다.

제안 사항?

내 코드는 이제 다음과 같습니다

$thumb = new Classes_Images_EasyThumbMaker(); 
$thumb -> Cropimage = array(1,0,20,20,35,35); // maybe something should be set here.        
$thumb -> Thumbwidth = 205; 
$thumb -> Thumbheight = 156; 
$thumb -> Quality = 100; 
// Full path to the images 
$pathToImage = 'uploads/portfolio/original/' . basename($form->image->getFileName()); 
//$thumb -> Chmodlevel = '0755'; 
$thumb -> Thumblocation = 'uploads/portfolio/thumb/'; 
$thumb -> Thumbprefix = 'thumb_'; 
// Create the thumbnail and save it 
$thumb ->Createthumb($pathToImage, 'file'); 

답변

0

당신은 아마 당신의 파일에 대한 절대 경로를 사용할 필요가, 이런 식으로 뭔가 :

// Your full path to the images 
$dir = str_replace(chr(92),chr(47),getcwd()) . 'uploads/' ;