Add File Format Detection
This section describes how to add file format detection, so that only image files are routed to media analysis.
To add file format detection
- Add an idol.nifi > KeyViewRouteOnFileType processor to the canvas.
-
Click the queue between the KeyViewExtractFiles and KeyViewFilterDocument processor.
The queue is selected and handles appear so that you can modify the route.
- Drag the blue destination handle from the KeyViewFilterDocument processor to the KeyViewRouteOnFileType processor.
-
Right-click the KeyViewRouteOnFileType processor and click Configure.
The Configure Processor dialog box opens.
-
Click the Properties tab and set the following properties:
KeyView Filter Service Select the KeyView filter service that you created in Add a KeyView Service.
IDOL License Service The name of the IDOL License Service that you created in Create a License Service. -
Add a new property to route image files. With this processor, each property you create defines a new relationship (for more information, see the documentation for the KeyViewRouteOnFileType processor).
-
Click Add property
.
The Add Property dialog box opens.
-
Type a name for the property, for example
images
, and click OK.Another dialog box opens, so that you can set the value of the property.
- Specify the value
5,83,143,238
and click OK. These numbers are KeyView format codes (5 for BMP files, 83 for TIFF, 143 for JPEG, and 238 for PNG).
-
-
Click APPLY.
-
Create a connection between the KeyViewRouteOnFileType processor and the KeyViewFilterDocument processor.
The Create Connection dialog box opens.
-
In the For Relationships area, select the unmatched and unknown check boxes:
- unmatched - all file types that were successfully identified by KeyView, but did not match a property that you configured. In this example, this includes all files that were successfully identified but are not BMP, TIFF, JPEG, or PNG files.
- unknown - all file types that KeyView could not identify.
-
Click ADD.
The connection appears on the canvas. Any FlowFile that is processed successfully but does not represent a BMP, TIFF, JPEG, or PNG file is now routed to the KeyViewFilterDocument processor (as before). FlowFiles that represent one of the image formats are no longer routed to the KeyViewFilterDocument processor because you did not select the images relationship.
The following sections describe how to add media analysis to process the image files.