lib/Dropbox/Client.php
function getThumbnail($path, $format, $size)
    {
        Path::checkArgNonRoot("path", $path);
        Checker::argString("format", $format);
        Checker::argString("size", $size);
        if (!in_array($format, array("jpeg", "png"))) {
            throw new \InvalidArgumentException("Invalid 'format': ".Util::q($format));
        }
        if (!in_array($size, array("xs", "s", "m", "l", "xl"))) {
            throw new \InvalidArgumentException("Invalid 'size': ".Util::q($size));
        }

        $url = $this->buildUrlForGetOrPut(
            $this->contentHost,
            $this->appendFilePath("1/thumbnails", $path),
            array("size" => $size, "format" => $format));

        $curl = $this->mkCurl($url);
        $metadataCatcher = new DropboxMetadataHeaderCatcher($curl->handle);

        $curl->set(CURLOPT_RETURNTRANSFER, true);
        $response = $curl->exec();

        if ($response->statusCode === 404) return null;
        if ($response->statusCode !== 200) throw RequestUtil::unexpectedStatus($response);

        $metadata = $metadataCatcher->getMetadata();
        return array($metadata, $response->body);
    }
function getThumbnail($path, $format, $size)
    {
        Path::checkArgNonRoot("path", $path);
        Checker::argString("format", $format);
        Checker::argString("size", $size);
        if (!in_array($format, array("jpeg", "png"))) {
            throw new \InvalidArgumentException("Invalid 'format': ".Util::q($format));
        }
        if (!in_array($size, array("xs", "s", "m", "l", "xl"))) {
            throw new \InvalidArgumentException("Invalid 'size': ".Util::q($size));
        }

        $url = $this->buildUrlForGetOrPut(
            $this->contentHost,
            $this->appendFilePath("1/thumbnails", $path),
            array("size" => $size, "format" => $format));

        $curl = $this->mkCurl($url);
        $metadataCatcher = new DropboxMetadataHeaderCatcher($curl->handle);

        $curl->set(CURLOPT_RETURNTRANSFER, true);
        $response = $curl->exec();

        if ($response->statusCode === 404) return null;
        if ($response->statusCode !== 200) throw RequestUtil::unexpectedStatus($response);

        $metadata = $metadataCatcher->getMetadata();
        return array($metadata, $response->body);
    }
Gets a thumbnail image representation of the file at the given path.

See <a href="https://www.dropbox.com/developers/core/docs#thumbnails">/thumbnails</a>.

@param string $path
The path to the file you want a thumbnail for (UTF-8).

@param string $format
One of the two image formats: "jpeg" or "png".

@param string $size
One of the predefined image size names, as a string:
<ul>
<li>"xs" - 32x32</li>
<li>"s" - 64x64</li>
<li>"m" - 128x128</li>
<li>"l" - 640x480</li>
<li>"xl" - 1024x768</li>
</ul>

@return array|null
If the file exists, you'll get `list(array $metadata, string $data)` where
`$metadata` is the file's
<a href="https://www.dropbox.com/developers/core/docs#metadata-details">metadata object</a>
and $data is the raw data for the thumbnail image.  If the file doesn't exist, you'll
get `null`.

@throws Exception