-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
444 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
description: Image Criterion | ||
--- | ||
|
||
# Image Criterion | ||
|
||
The `Image` Search Criterion searches for image by specified image attributes. | ||
|
||
## Arguments | ||
|
||
- `fieldDefIdentifier` - string representing the identifier of the Field | ||
- `imageCriteriaData` - array representing image attributes. All attributes are optional. | ||
|
||
## Example | ||
|
||
### PHP | ||
|
||
``` php | ||
$imageCriteriaData = [ | ||
'mimeTypes' => [ | ||
'image/png', | ||
], | ||
'orientation' => [ | ||
'image/png', | ||
], | ||
'width' => [ | ||
'min' => 0, // (default: 0, optional) | ||
'max' => 1000, // (default: null, optional) | ||
], | ||
'height' => [ | ||
'min' => 0, // (default: 0, optional) | ||
'max' => 1000, // (default: null, optional) | ||
], | ||
'size' => [ | ||
'min' => 0, // (default: 0, optional) | ||
'max' => 2, // (default: null, optional) | ||
], | ||
]; | ||
$query->query = new Criterion\Image('image', $imageCriteriaData); | ||
``` | ||
|
||
### REST API | ||
|
||
=== "XML" | ||
|
||
```xml | ||
<Query> | ||
<Filter> | ||
<ImageCriterion> | ||
<fieldDefIdentifier>image</fieldDefIdentifier> | ||
<mimeTypes>image/png</mimeTypes> | ||
<size> | ||
<min>0</min> | ||
<max>2</max> | ||
</size> | ||
<width> | ||
<min>100</min> | ||
<max>1000</max> | ||
</width> | ||
<height> | ||
<min>500</min> | ||
<max>1500</max> | ||
</height> | ||
<orientation>portrait</orientation> | ||
</ImageCriterion> | ||
</Filter> | ||
</Query> | ||
``` | ||
|
||
=== "JSON" | ||
|
||
```json | ||
"Query": { | ||
"Filter": { | ||
"ImageCriterion": { | ||
"fieldDefIdentifier": "image", | ||
"mimeTypes": "image/png", | ||
"size": { | ||
"max": 1.5 | ||
}, | ||
"width": { | ||
"max": 1000 | ||
}, | ||
"height": { | ||
"max": 1500 | ||
}, | ||
"orientation": "portrait" | ||
} | ||
} | ||
} | ||
|
||
OR | ||
|
||
"Query": { | ||
"Filter": { | ||
"ImageCriterion": { | ||
"fieldDefIdentifier": "image", | ||
"mimeTypes": [ | ||
"image/png", | ||
"image/jpeg" | ||
], | ||
"size": { | ||
"min": 0, | ||
"max": 2 | ||
}, | ||
"width": { | ||
"min": 100, | ||
"max": 1000 | ||
}, | ||
"height": { | ||
"min": 500, | ||
"max": 1500 | ||
}, | ||
"orientation": [ | ||
"portrait", | ||
"landscape" | ||
] | ||
} | ||
} | ||
} | ||
``` |
73 changes: 73 additions & 0 deletions
73
docs/search/criteria_reference/imagedimensions_criterion.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
description: Image Dimensions Criterion | ||
--- | ||
|
||
# Image Dimension Criterion | ||
|
||
The `Dimensions` Search Criterion searches for image with specified dimensions. | ||
|
||
## Arguments | ||
|
||
- `fieldDefIdentifier` - string representing the identifier of the Field | ||
- `imageCriteriaData` - an array representing minimum and maximum values for width and height, expressed in pixels | ||
|
||
## Example | ||
|
||
### PHP | ||
|
||
``` php | ||
$imageCriteriaData = [ | ||
'width' => [ | ||
'min' => 100, // (default: 0, optional) | ||
'max' => 1000, // (default: null, optional) | ||
], | ||
'height' => [ | ||
'min' => 500, // (default: 0, optional) | ||
'max' => 1500, // (default: null, optional) | ||
], | ||
]; | ||
|
||
$query->query = new Criterion\Dimensions('image', $imageCriteriaData); | ||
``` | ||
|
||
### REST API | ||
|
||
=== "XML" | ||
|
||
```xml | ||
<Query> | ||
<Filter> | ||
<ImageDimensionsCriterion> | ||
<fieldDefIdentifier>image</fieldDefIdentifier> | ||
<width> | ||
<min>100</min> | ||
<max>1000</max> | ||
</width> | ||
<height> | ||
<min>500</min> | ||
<max>1500</max> | ||
</height> | ||
</ImageDimensionsCriterion> | ||
</Filter> | ||
</Query> | ||
``` | ||
|
||
=== "JSON" | ||
|
||
```json | ||
"Query": { | ||
"Filter": { | ||
"ImageDimensionsCriterion": { | ||
"fieldDefIdentifier": "image", | ||
"width": { | ||
"min": 100, | ||
"max": 1000 | ||
}, | ||
"height": { | ||
"min": 500, | ||
"max": 1500 | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
description: Image FileSize Criterion | ||
--- | ||
|
||
# Image FileSize Criterion | ||
|
||
The `FileSize` Search Criterion searches for image with specified size. | ||
|
||
## Arguments | ||
|
||
- `fieldDefIdentifier` - string representing the identifier of the Field | ||
- (optional) `minValue` - numeric representing minimum file size expressed in MB, default: 0 | ||
- (optional) `maxValue` - numeric representing maximum file size expressed in MB, default: `null` | ||
|
||
## Example | ||
|
||
### PHP | ||
|
||
``` php | ||
$query->query = new Criterion\FileSize('image', 0, 1.5); | ||
``` | ||
|
||
### REST API | ||
|
||
=== "XML" | ||
|
||
```xml | ||
<Query> | ||
<Filter> | ||
<ImageFileSizeCriterion> | ||
<fieldDefIdentifier>image</fieldDefIdentifier> | ||
<size> | ||
<min>0</min> | ||
<max>1.5</max> | ||
</size> | ||
</ImageFileSizeCriterion> | ||
</Filter> | ||
</Query> | ||
``` | ||
|
||
=== "JSON" | ||
|
||
```json | ||
"Query": { | ||
"Filter": { | ||
"ImageFileSizeCriterion":{ | ||
"fieldDefIdentifier": "image", | ||
"size": { | ||
"min": 0, | ||
"max": 1.5 | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
description: Image Height Criterion | ||
--- | ||
|
||
# Image Height Criterion | ||
|
||
The `Height` Search Criterion searches for image with specified height. | ||
|
||
## Arguments | ||
|
||
- `fieldDefIdentifier` - string representing the identifier of the Field | ||
- (optional) `minValue` - int representing minimum file height expressed in pixels, default: 0 | ||
- (optional) `maxValue` - int representing maximum file height expressed in pixels, default: `null` | ||
|
||
## Example | ||
|
||
### PHP | ||
|
||
``` php | ||
$query->query = new Criterion\Height('image', 0, 1500); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
description: Image MimeType Criterion | ||
--- | ||
|
||
# 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 | ||
|
||
``` php | ||
$query->query = new Criterion\MimeType('image', 'image/jpeg'); | ||
``` | ||
|
||
or | ||
|
||
```php | ||
$mimeTypes = [ | ||
'image/jpeg', | ||
'image/png', | ||
]; | ||
|
||
$query->query = new Criterion\MimeType('image', $mimeTypes); | ||
``` | ||
|
||
### REST API | ||
|
||
=== "XML" | ||
|
||
```xml | ||
<Query> | ||
<Filter> | ||
<ImageMimeTypeCriterion> | ||
<fieldDefIdentifier>image</fieldDefIdentifier> | ||
<type>image/png</type> | ||
</ImageMimeTypeCriterion> | ||
</Filter> | ||
</Query> | ||
``` | ||
|
||
=== "JSON" | ||
|
||
```json | ||
"Query": { | ||
"Filter": { | ||
"ImageMimeTypeCriterion": { | ||
"fieldDefIdentifier": "image", | ||
"type": "image/png" | ||
} | ||
} | ||
} | ||
|
||
OR | ||
|
||
"Query": { | ||
"Filter": { | ||
"ImageMimeTypeCriterion": { | ||
"fieldDefIdentifier": "image", | ||
"type": ["image/png", "image/jpeg"] | ||
} | ||
} | ||
} | ||
``` |
Oops, something went wrong.