Thumbnail
Generate a smaller preview image from an image, video, or document.
File-first
thumbnail() requires both width and height. The fit option
(max / crop / scale) controls how the source is fitted to those
dimensions. Omitting either is rejected with a GislConfigError before any
upload — there is no wasted round trip.
- TypeScript
- PHP
- Python
- Rust
const result = await client
.file('./photo.jpg')
.thumbnail({ width: 200, height: 200 })
.run({ maxWait: '5m' });
console.log(result.url);
$run = $client->file('./photo.jpg')
->thumbnail(['width' => 200, 'height' => 200])
->run(maxWait: '5m');
echo $run->url;
Coming soon.
Coming soon.
Chaining
Thumbnail the output of a prior step in the same workflow — for example, compress first, then thumbnail the compressed result:
- TypeScript
- PHP
- Python
- Rust
import { OptimizeFor } from '@giveitsmaller/sdk';
const result = await client
.file('./photo.jpg')
.compress(OptimizeFor.Size)
.thumbnail({ width: 200, height: 200 })
.run({ maxWait: '5m' });
use Gisl\Sdk\Generated\SdkSpec\Enums\OptimizeFor;
$run = $client->file('./photo.jpg')
->compress(OptimizeFor::Size)
->thumbnail(['width' => 200, 'height' => 200])
->run(maxWait: '5m');
Coming soon.
Coming soon.