Skip to content

Commit effd4a9

Browse files
docs(preview): clarify IProviderV2 thumbnail and preview terminology
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 1eb5f13 commit effd4a9

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

lib/public/Preview/IProviderV2.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,37 @@
1313
use OCP\IImage;
1414

1515
/**
16+
* Public interface for preview providers.
17+
*
18+
* A preview provider generates a thumbnail image for supported files. That image
19+
* may be stored and reused by the preview system.
20+
*
1621
* @since 17.0.0
1722
*/
1823
interface IProviderV2 {
1924
/**
20-
* @return string Regex with the mimetypes that are supported by this provider
25+
* Returns the mime-type regex supported by this provider.
26+
*
27+
* @return string Regex matching the mime types supported by this provider
2128
* @since 17.0.0
2229
*/
2330
public function getMimeType(): string;
2431

2532
/**
26-
* Check if a preview can be generated for $path
33+
* Returns whether this provider can currently generate a thumbnail for the given file.
2734
*
2835
* @param FileInfo $file
29-
* @return bool
3036
* @since 17.0.0
3137
*/
3238
public function isAvailable(FileInfo $file): bool;
3339

3440
/**
35-
* get thumbnail for file at path $path
41+
* Generates a thumbnail image for the given file.
3642
*
3743
* @param File $file
38-
* @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
39-
* @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
40-
* @return null|\OCP\IImage null if no preview was generated
44+
* @param int $maxX Maximum thumbnail width; the returned image may be smaller depending on its aspect ratio
45+
* @param int $maxY Maximum thumbnail height; the returned image may be smaller depending on its aspect ratio
46+
* @return IImage|null Null if no thumbnail could be generated
4147
* @since 17.0.0
4248
*/
4349
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage;

0 commit comments

Comments
 (0)