//index.php
$img_dir ="C:/xampp/folders/img/*.jpg";
$thumb_width = 100;
// Open a known directory, and proceed to read its contents
$scan= glob($img_dir);
foreach($scan as $image) {
$im= imagecreatefromjpeg($image);
$img_width = imagesx($im);
$img_height=imagesy($im);
$thumb_height= floor ($img_height *($thumb_width/$img_width));
$new_img=imagecreatetruecolor($thumb_width,$thumb_height);
imagecopyresized($new_img, $im, 0,0, 0, 0, $thumb_width, $thumb_height, $img_width, $img_height);
$thumb_path = "C:/xampp/folders/thumbs/";
imagejpeg($new_img,$thumb_path);
}
The error message
Warning: imagejpeg(C:\xampp\folders\thumbs): failed to open stream: Permission denied in C:\xampp\folders\index.php on line 32
he destination file has read and write permissions! Whats wrong with my code?
( I have used both / and \ slashes for file paths, and I still get the same error.)