에 대한 imagejpeg()을 수행 할 수 없습니다나는이 코드를 가지고 있고이 일해야 할 여러 이미지
if ($handle = opendir("images/")) { $i=0;
while (false !== ($file = readdir($handle))){
if ($file != "." && $file != ".." && $file != "Recursive Dir_Renfiles_dirname-filename.php") {
$filename[$i]=$file;
$i++;
}}}
//print_r($filename);
foreach($filename as $filename){
$percent = 0.5;
// Content type
header('Content-Type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
}
을 I가이 일을 할 수있는 방법? 아니면 다른 방법이 있습니까? 당신이 한 페이지에 여러 이미지를 원하는 경우
적어도 문제가 무엇인지 설명해보십시오. ('이 코드 덩어리는 효과가 없습니다'는 설명이 아닙니다.) – GolezTrol
'imagejpeg()'는 이미지를 출력합니다. 다중 출력을 생성 할 수 없습니다. 정확히 무엇을하려는 거니? 이 이미지들을 함께 섞으려고하십니까? – Tchoupi
예 - 우리의 질문은 - 정확하게 작동하지 않는 것은 무엇입니까? 우리가 알다시피, 당신은이 파일들을 쓸 수있는 권한이 없을 수도 있습니다 - 이것은 코드를 보면 알 수없는 것입니다. – Webnet