Since version 0.8.9, Perun2 supports detection of two common classes of files: images and videos. It uses a huge database of file formats, so if something is a picture, it will definitely be identified. There are four new variables we can use in expressions.
These classes have unique attributes. Width and height for both images and videos. Duration only for videos.
Special attributes can be also applied generally to files.
Booleans isImage and isVideo are useful in logic expressions.
The detection algorithm is accurate and reliable. Every single file is opened and checked thoroughly. We have to pay the price - it is visibly slow when thousands of files are involved.
If the performance is important, you should stay with fast but less accurate extension comparisons. The execution takes milliseconds instead of seconds.