I have the following scenario. I have about around 600 pictures. Most of theme have in bottom a logo which should be cut it out because branding issue, but not all of theme.(with ftp and photoshop would be a challange)The approach what I was thinking about I list all of my images form folders and I add to theme a hyperlink which should fire on a method class which cuts out 57px from bottom, because the image listing limited to height and width, after cutting should not be present on the page
the url looks like
cut.php?target=http://example.com/hideit/2012/03/myimage.jpg
I want to reset the get parameter after execution to avoid problems on page refresh while would cut again from that image the defined pixels. I was trying the following
function cutAndsave($jpg){
$folder = explode('/', $jpg);
$path = 'I:\\xampp\\htdocs\\hideit\\'. $folder[4]. '\\'. $folder[5] .'\\'.$folder[6] ;
list($width, $height) = getimagesize($jpg);
$offset_x = 0;
$offset_y = 0;
$new_height = $height - 57;
$new_width = $width;
$image = imagecreatefromjpeg($jpg);
$new_image = imagecreatetruecolor($new_width, $new_height);
imagecopy($new_image, $image, 0, 0, $offset_x, $offset_y, $width, $height);
header('Content-Type: image/jpeg');
imagejpeg($new_image,$path, 90);
header("Location: /cat.php/");
die();
}
but the last header call won't work in my case