PHP Image getting rotated automatically on upload

function saveImageData($base64Data) {
    $base64_decoded = base64_decode($base64Data);
    $im = imagecreatefromstring($base64_decoded);
    if ($im !== false) {
        $imagepath = '/public/uploads/' . time() . '.jpg';
        imagejpeg($im, $imagepath);
        chmod($imagepath, 0755);
        imagedestroy($im);
    } else {
        return false;
    }
    return $imagepath;
}
PHP Image getting rotated automatically on upload Dev2Tricks 5 of 5
function saveImageData($base64Data) {     $base64_decoded = base64_decode($base64Data);     $im = imagecreatefromstring($base64_dec...

Share this

Related Posts

Previous
Next Post »