public function prewriteRotate() { $degrees = $this->_getDegrees(); if (!$degrees) { return true; } $tmp_file = $this->_upload->upload['tmp_name']; $cpy_file = $tmp_file . '.rs'; $result = PHPWS_File::rotateImage($tmp_file, $cpy_file, $degrees); if (!PHPWS_Error::logIfError($result) && !$result) { return PHPWS_Error::get(FC_IMAGE_DIMENSION, 'filecabinet', 'PHPWS_Image::prewriteRotate', array($this->width, $this->height, $this->_max_width, $this->_max_height)); } else { if (!@copy($cpy_file, $tmp_file)) { return PHPWS_Error::get(FC_IMAGE_DIMENSION, 'filecabinet', 'PHPWS_Image::prewriteRotate', array($this->width, $this->height, $this->_max_width, $this->_max_height)); } else { list($this->width, $this->height, $image_type, $image_attr) = getimagesize($tmp_file); return true; } } return true; }