PHPExiftool\Writer::reset PHP Method

reset() public method

public reset ( )
    public function reset()
    {
        $this->mode = 0;
        $this->modules = 0;
        $this->erase = false;
        $this->eraseProfile = false;
        return $this;
    }

Usage Example

 /**
  * Generates a metadatas-free version of the file in the temporary directory
  *
  * @return string the path file to the temporary file
  */
 private function getTemporaryEmptyFile()
 {
     $tmpFile = tempnam(sys_get_temp_dir(), 'hash');
     unlink($tmpFile);
     try {
         $this->writer->reset();
         $this->writer->erase(true);
         $this->writer->write($this->file->getPathname(), new MetadataBag(), $tmpFile);
     } catch (PHPExiftoolExceptionInterface $e) {
         /**
          * Some files can not be written by exiftool
          */
         copy($this->file->getPathname(), $tmpFile);
     }
     $this->temporaryFiles[] = $tmpFile;
     return $tmpFile;
 }