# Indexed Artwork

The Artwork Information statement provides the ability to perform various operations on artwork items in a position independent manner. This statement provides access to various functionality on a single artwork item at a specified index. Note that the indexes are zero based. Index zero represents the default artwork item in any file.

All text fields may contain any of the sequences described in Escape Sequences.

The Get Index of Matching Item function is radically different than the other functions in that it is the only function which does not supply an index. The Get Index of Matching Item function is described at the end of the document.

By default, the index field is only evaluated once. This means that a single index is used for all files. When not saving results to a named variable, there is a Per file option. When Per file is set, the index will be evaluated for every file.

The action test state is set as follows:

- If the index is invalid for all files, it is set to false.
- When the function is Set as Default, it will be set to false if no artwork items are relocated.
- For any function saving information to a named variable, if the artwork item at the specified index is not the same for all files, it will be set to false.
- It will be set to true. ie. something was done.

If information is being saved and the function fails for any reason, the stored result will be the empty string. This is on a per file basis.

The following functions are currently available:

> Set description
>   Set the artwork item's description field to the specified data. The data field is evaluated for each file.
> Set picture type
>   Set the artwork item's picture type to the specified data. The data must either be one of the well defined picture types or an integer value representing the index of the picture type. If the data is not valid the picture type will be set to Other. A value picker is supplied as a convenience. The data field is evaluated for each file.
> Get description
>   Set the destination variable to the artwork item's description field.
> Get index of picture type
>   Set the destination variable to the index of the artwork item's picture type.
> Get picture type
>   Set the destination variable to the textual representation of the artwork item's picture type.
> Get mime type
>   Set the destination variable to the artwork item's mime type. Note that the * indicator used to denote a progressive JPEG in the UI is not returned here. Use the Get is Progressive JPEG function to determine if an image is progressive.
> Get width x height
>   Set the destination variable to the artwork item's dimensions.
> Get pixel count
>   Set the destination variable to the artwork item's pixel count.
> Get data size
>   Set the destination variable to the size of the artwork data in bytes.
> Set as Default
>   The artwork item at the specified index is moved to index 0 and as such becomes the default artwork.
> Get is Progressive JPEG
>   Set the destination variable to 1 if the image is a progressive JPEG, otherwise 0.
> Get Resolution
>   Set the destination variable to the resolution (PPI) of the image.

The following list describes the supported picture types and their associated indexes.

0. Other
1. 32x32 pixels 'file icon' PNG only
2. Other file icon
3. Cover (front)
4. Cover (back)
5. Leaflet page
6. Media (CD label)
7. Lead artist/lead performer/soloist
8. Artist/performer
9. Conductor
10. Band/Orchestra
11. Composer
12. Lyricist/text writer
13. Recording Location
14. During recording
15. During performance
16. Movie/video screen capture
17. A bright coloured fish
18. Illustration
19. Band/artist logotype
20. Publisher/Studio logotype

# Get Index of Matching Item

The function is used to find the first artwork item in every active file which matches a picture type and/or description. The description test is performed case insensitive and can require an entire match or that the supplied text is contained in the description. The picture type data must either be one of the well defined picture types or an integer value representing the index of the picture type. If the picture type data is invalid, no attempt will be made to match the picture type.

A matched index or -1 is returned in the specified named or track variable.

It makes no sense to save the results to a named variable unless you know that there is only a single active file. Only a single file is processed when a named variable is used.

The action test state is set to true if any matches were made, otherwise false.