Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function importFromDisk ( $file, $bTrim=false, $hash=NULL )
- {
- // INCOMING is set in /index.php -- creates a temporary, working filename to be used to create thumbnails
- // echo 'hash: ' . ( is_null( $hash ) ? self::generateHash( basename( $file ) ) : $hash ) . '<BR>';
- $this->working = INCOMING . '/' . ( is_null( $hash ) ? self::generateHash( basename( $file ) ) : $hash );
- // echo $this->working.'<BR>';
- if ( file_exists($this->working) ) // does it already exist?
- unlink($this->working); // remove file
- if ( false === copy( $file, $this->working ) )
- {
- $this->working = NULL;
- throw new Exception('Unable to read file from disk');
- }
- // do we want to trim this image on import?
- if ( $bTrim )
- self::trimimage( $this->working );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement