Exemple #1
0
        //save the new image
        imagedestroy($source);
        //free up the memory
        imagedestroy($rotate);
        //free up the memory
    }
}
switch ($rotatedBy) {
    case '_a':
        $newFilepath = 'images/' . $coreName . '_b.' . $extension . '';
        $coreName = $coreName . '_b';
        ifFileDoesntExistRotate($newFilepath, $filepath);
        break;
    case '_b':
        $newFilepath = 'images/' . $coreName . '_c.' . $extension . '';
        $coreName = $coreName . '_c';
        ifFileDoesntExistRotate($newFilepath, $filepath);
        break;
    case '_c':
        $newFilepath = 'images/' . $coreName . '.' . $extension . '';
        ifFileDoesntExistRotate($newFilepath, $filepath);
        break;
    default:
        $newFilepath = 'images/' . $coreName . '_a.' . $extension . '';
        $coreName = $coreName . '_a';
        ifFileDoesntExistRotate($newFilepath, $filepath);
}
$pictures->updateFilepath($picture_id, $newFilepath);
$pictures->updatePicName($picture_id, $coreName);
$pictures->closeConnection();
echo $newFilepath;