public function populate(EventInterface $event) {
        // Read the image
        $image = $event->getRequest()->getImage();
        $this->imagick->readImageBlob($image->getBlob());

        // Get 8BIM-properties from image - this seems to be the best way to get the identifiers
        // with path names in a raw format
        $this->imagick->setImageFormat('8bimtext');
        $data = $this->imagick->getImageBlob();

        // Find paths - all paths are located in identifiers 2000 through 2997
        preg_match_all('/^8BIM#2(\d{3})#(.+?)=/m', $data, $matches);

        if ($matches) {
            // Order the paths by their ids in the 8BIM format
            $paths = [];

            foreach ($matches[1] as $idx => $pathId) {
                $paths[$pathId] = $matches[2][$idx];
            }

            ksort($paths);

            $this->properties['paths'] = array_values($paths);
        }

        return $this->properties;
    }
public function populate(EventInterface $event) {
        // Read the image
        $image = $event->getRequest()->getImage();
        $this->imagick->readImageBlob($image->getBlob());

        // Get 8BIM-properties from image - this seems to be the best way to get the identifiers
        // with path names in a raw format
        $this->imagick->setImageFormat('8bimtext');
        $data = $this->imagick->getImageBlob();

        // Find paths - all paths are located in identifiers 2000 through 2997
        preg_match_all('/^8BIM#2(\d{3})#(.+?)=/m', $data, $matches);

        if ($matches) {
            // Order the paths by their ids in the 8BIM format
            $paths = [];

            foreach ($matches[1] as $idx => $pathId) {
                $paths[$pathId] = $matches[2][$idx];
            }

            ksort($paths);

            $this->properties['paths'] = array_values($paths);
        }

        return $this->properties;
    }
public function populate ( EventInterface $ event ) { // Read the image $ image = $ event -> getRequest ( ) -> getImage ( ) ; $ this -> imagick -> readImageBlob ( $ image -> getBlob ( ) ) ; // Get 8BIM-properties from image - this seems to be the best way to get the identifiers // with path names in a raw format $ this -> imagick -> setImageFormat ( '8bimtext' ) ; $ data = $ this -> imagick -> getImageBlob ( ) ; // Find paths - all paths are located in identifiers 2000 through 2997 preg_match_all ( '/^8BIM#2(\d{3})#(.+?)=/m' , $ data , $ matches ) ; if ( $ matches ) { // Order the paths by their ids in the 8BIM format $ paths = [ ] ; foreach ( $ matches [ 1 ] as $ idx => $ pathId ) { $ paths [ $ pathId ] = $ matches [ 2 ] [ $ idx ] ; } ksort ( $ paths ) ; $ this -> properties [ 'paths' ] = array_values ( $ paths ) ; } return $ this -> properties ; }
Read 8BIM data from incoming image

@param EventInterface $event The triggered event
@return array
Read 8BIM data from incoming image