Skip to content

Image MimeType Criterion

The MimeType Search Criterion searches for image with specified mime type(s).

Arguments

  • fielDefIdentifier - string representing the identifier of the Field
  • type - string(s) representing mime type(s)

Example

PHP

1
$query->query = new Criterion\MimeType('image', 'image/jpeg');

or

1
2
3
4
5
6
$mimeTypes = [
    'image/jpeg',
    'image/png',
];

$query->query = new Criterion\MimeType('image', $mimeTypes);

REST API

1
2
3
4
5
6
7
8
<Query>
    <Filter>
        <ImageMimeTypeCriterion>
            <fieldDefIdentifier>image</fieldDefIdentifier>
            <type>image/png</type>
        </ImageMimeTypeCriterion>
    </Filter>
</Query>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
"Query": {
    "Filter": {
        "ImageMimeTypeCriterion": {
            "fieldDefIdentifier": "image",
            "type": "image/png"
        }
    }
}

OR

"Query": {
    "Filter": {
        "ImageMimeTypeCriterion": {
            "fieldDefIdentifier": "image",
            "type": ["image/png", "image/jpeg"]
        }
    }
}