.github/workflows/build.yml000064400000001213150731645730011773 0ustar00name: Tests on: [push] jobs: run: runs-on: ubuntu-latest strategy: matrix: php: ['7.4', '8.0', '8.1'] name: Testing on PHP ${{ matrix.php }} steps: - name: Checkout uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: mbstring,bcmath tools: composer - name: Install PHP dependencies run: composer install -q - name: Run phpunit run: vendor/bin/phpunit - name: Run phpstan run: vendor/bin/phpstan analyze --no-progress --level=5 src/ .gitignore000064400000000102150731645730006540 0ustar00.DS_Store composer.lock vendor/ dev/ .idea/ .phpunit.result.cache Dockerfile000064400000000216150731645730006550 0ustar00FROM php:8-cli # install composer # RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer LICENSE000064400000002066150731645730005570 0ustar00The MIT License (MIT) Copyright (c) 2019 Oliver Vogel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.README.md000075500000007530150731645730006046 0ustar00# PHP Media type (MIME) detector ![build](https://github.com/Intervention/mimesniffer/workflows/build/badge.svg) Detecting MIME Content-type in PHP is easy with [mime_content_type](https://www.php.net/manual/en/function.mime-content-type.php) or [Fileinfo](https://www.php.net/manual/en/book.fileinfo.php). But Fileinfo as an extension is sometimes not available on the server. The function `mime_content_type` wants a path to the filesystem as argument and doesn't process if we only have a string value. This package makes it easy to detect the mime types of the content of a given file or string, without any extension dependencies. ## Installation Install the package easily via composer: ```bash composer require intervention/mimesniffer ``` ## Usage Here are some code samples, to show how the library is handled. ```php use Intervention\MimeSniffer\MimeSniffer; use Intervention\MimeSniffer\Types\ImageJpeg; // detect given string $sniffer = MimeSniffer::createFromString($content); // or detect given file $sniffer = MimeSniffer::createFromFilename('image.jpg'); // returns object of detected type $type = $sniffer->getType(); $bool = $type->isBinary(); // check if we have binary data $bool = $type->isImage(); // check if we are dealing with an image $bool = $type->isVideo(); // check video data was detected $bool = $type->isAudio(); // check if we have detected audio data $bool = $type->isArchive(); // check if an archive was detected $type = (string) $type; // cast type to string (e.g. "image/jpeg") // you can also check, if the content matches a specific type $bool = $sniffer->matches(new ImageJpeg); // or check, if the content matches an array of types $bool = $sniffer->matches([ImageJpeg::class, ImageGif::class]); // or check, if the content matches an array of type objects $bool = $sniffer->matches([new ImageJpeg, $type]); ``` If your prefer non-static initialization: ```php use Intervention\MimeSniffer\MimeSniffer; // create instance with constructor $sniffer = new MimeSniffer($content); // with setter for given content $type = $sniffer->setFromString($other_content)->getType(); // or with setter for filename $type = $sniffer->setFromFilename('images/image.jpg')->getType(); ``` **Currently only the following file types can be detected. More will be added in a next release.** ### Images - Image encoded as JPEG raw or in the JFIF or Exif file format - Image file encoded in the Graphics Interchange Format (GIF) - Image encoded in the Portable Network Graphics format (PNG) - Image encoded as BMP file, a bitmap format - Image encoded in High Efficiency Image File Format (HEIC/HEIF) - Icon encoded in ICO file format - Image in Google WebP image format - Scalable Vector Graphics (SVG) - Tagged Image File Format (TIFF) - Image encoded Photoshop Document file format (PSD) - AV1 Image File Format (AVIF) ### Archives - GZIP compressed - ZIP file - RAR archive - TAR file ### Videos - AVI - MPEG-1 and MPEG-2 video - MKV media container ### Audio - MP3 file - FLAC file ### Other - PDF document - OGG media container - SQLite Database - application/octet-stream (default binary) - text/plain (default) ## Contributing Contributions are welcome. Please note the following guidelines before submiting your pull request. - Follow [PSR-2](http://www.php-fig.org/psr/psr-2/) coding standards. - Write tests for new functions and added features ## Development & Testing With this package comes a Docker image to build a test suite and analysis container. To build this container you have to have Docker installed on your system. You can run all tests with this command. ```bash docker-compose run --rm --build tests ``` Run the static analyzer on the code base. ```bash docker-compose run --rm --build analysis ``` ## License Licensed under the [MIT License](http://opensource.org/licenses/MIT). Copyright 2019 [Oliver Vogel](https://olivervogel.com/) composer.json000064400000001422150731645730007300 0ustar00{ "name": "intervention/mimesniffer", "description": "PHP MIME Type Sniffer", "homepage": "http://intervention.io/", "keywords": ["mime", "type", "sniffer", "detector"], "license": "MIT", "authors": [ { "name": "Oliver Vogel", "email": "oliver@intervention.io", "homepage": "https://intervention.io/" } ], "require": { "php": "^7.3|^8.0" }, "require-dev": { "phpunit/phpunit": "^9.0", "phpstan/phpstan": "^1" }, "autoload": { "psr-4": { "Intervention\\MimeSniffer\\": "src" } }, "autoload-dev": { "psr-4": { "Intervention\\MimeSniffer\\Test\\": "tests" } }, "minimum-stability": "stable" } docker-compose.yml000064400000000535150731645730010217 0ustar00version: '3' services: tests: build: ./ working_dir: /project command: bash -c "composer install && ./vendor/bin/phpunit -vvv" volumes: - ./:/project analysis: build: ./ working_dir: /project command: bash -c "composer install && ./vendor/bin/phpstan analyze --level=4 ./src" volumes: - ./:/project phpunit.xml000064400000001035150731645730006767 0ustar00 ./tests/ src/AbstractBinaryType.php000064400000001024150731645730011626 0ustar00pattern, $this->prepareContent($content)) === 1; } /** * Determine if the detected type is an image * * @return boolean */ public function isImage(): bool { return substr($this->name, 0, 5) === 'image'; } /** * Determine if the detected type is an video * * @return boolean */ public function isVideo(): bool { return substr($this->name, 0, 5) === 'video'; } /** * Determine if the detected type is an audio file * * @return boolean */ public function isAudio(): bool { return substr($this->name, 0, 5) === 'audio'; } /** * Determine if the detected type is an archive * * @return boolean */ public function isArchive(): bool { return in_array($this->name, [ 'application/zip', 'application/x-rar-compressed', 'application/x-tar', 'application/gzip', ]); } /** * Prepare content (can be extended by child classes) * * @param string $content * @return string */ public function prepareContent(string $content): string { return substr($content, 0, 1024); } /** * Determine of current type is binary * * @return boolean */ public function isBinary(): bool { return false; } /** * Cast type to string * * @return string */ public function __toString(): string { return $this->name; } } src/Exceptions/NotMatchingException.php000064400000000240150731645730014266 0ustar00setFromString($content); } /** * Create new instance from given string * * @param string $content * * @return MimeSniffer */ public static function createFromString(string $content): MimeSniffer { return new self($content); } /** * Load contents of given string into instance * * @param string $content * * @return MimeSniffer */ public function setFromString(string $content): MimeSniffer { $this->content = strval($content); return $this; } /** * Create a new instance and load contents of given filename * * @param string $filename * * @return MimeSniffer */ public static function createFromFilename(string $filename): MimeSniffer { return (new self())->setFromFilename($filename); } /** * Load contents of given filename in current instance * * @param string $filename * * @return MimeSniffer */ public function setFromFilename(string $filename): MimeSniffer { $fp = fopen($filename, 'r'); $this->setFromString(fread($fp, 1024)); fclose($fp); return $this; } /** * Return detected type * * @return AbstractType */ public function getType(): AbstractType { foreach ($this->getTypeClassnames() as $classname) { $type = new $classname(); if ($type->matches($this->content)) { return $type; } } $binaryType = new Types\ApplicationOctetStream(); if ($this->matches($binaryType)) { return $binaryType; } return new Types\TextPlain(); } /** * Determine if content matches the given type * or any if the given types in array * * @param AbstractType|array $types AbstractType or array of AbstractTypes * @return boolean */ public function matches($types): bool { if (! is_array($types)) { $types = [$types]; } $types = array_map(function ($value) { if (is_a($value, AbstractType::class)) { return $value; } if (!is_null($value) && class_exists($value)) { return new $value(); } }, $types); $types = array_filter($types, function ($type) { return is_a($type, AbstractType::class); }); foreach ($types as $type) { if ($type->matches($this->content)) { return true; } } return false; } /** * Return array of type classnames * * @return array */ private function getTypeClassnames(): array { $files = array_diff(scandir(__DIR__ . '/Types'), ['.', '..']); $classnames = array_map(function ($filename) { return "Intervention\\MimeSniffer\\Types\\" . substr($filename, 0, -4); }, $files); return array_filter($classnames, function ($classname) { return ! in_array($classname, [ Types\ApplicationOctetStream::class, Types\TextPlain::class, ]); }); } } src/Types/ApplicationGzip.php000064400000000556150731645730012266 0ustar00]*\?>.*)?]*>/is"; } src/Types/ImageTiff.php000064400000000561150731645730011020 0ustar00getMockForAbstractClass(AbstractBinaryType::class); $this->assertEquals(1024, strlen($type->prepareContent($content))); $this->assertEquals('78787878', substr($type->prepareContent($content), 0, 8)); } public function testIsBinary() { $type = $this->getMockForAbstractClass(AbstractBinaryType::class); $this->assertTrue($type->isBinary()); } } tests/AbstractTypeTest.php000064400000002141150731645730011675 0ustar00getMockForAbstractClass(AbstractType::class); $this->assertEquals('', $type); } public function testMatches() { $type = $this->getMockForAbstractClass(AbstractType::class); $this->assertFalse($type->matches('test')); } public function testIsImage() { $type = $this->getMockForAbstractClass(AbstractType::class); $this->assertFalse($type->isImage()); } public function testPrepareContent() { $content = ''; for ($i = 0; $i < 2048; $i++) { $content .= 'x'; } $type = $this->getMockForAbstractClass(AbstractType::class); $this->assertEquals(1024, strlen($type->prepareContent($content))); } public function testIsBinary() { $type = $this->getMockForAbstractClass(AbstractType::class); $this->assertFalse($type->isBinary()); } } tests/ApplicationGzipTest.php000064400000001232150731645730012365 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/gzip'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationGzip::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } } tests/ApplicationOggTest.php000064400000001226150731645730012173 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/ogg'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationOgg::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } } tests/ApplicationPdfTest.php000064400000001226150731645730012170 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/pdf'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationPdf::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } } tests/ApplicationRarTest.php000064400000001231150731645730012177 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/rar'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationRar::class, $this->type); } public function testIsArchive() { $this->assertTrue($this->type->isArchive()); } } tests/ApplicationSqliteTest.php000064400000001104150731645730012713 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.sqlite'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationSqlite::class, $this->type); } } tests/ApplicationTarTest.php000064400000001236150731645730012206 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.tar'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationTar::class, $this->type); } public function testIsArchive() { $this->assertTrue($this->type->isArchive()); } } tests/ApplicationZipTest.php000064400000001231150731645730012215 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/zip'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ApplicationZip::class, $this->type); } public function testIsArchive() { $this->assertTrue($this->type->isArchive()); } } tests/AudioFlacTest.php000064400000001210150731645730011113 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/flac'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(AudioFlac::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } } tests/AudioMpegId3v2Test.php000064400000001221150731645730011750 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/mp3_id3v2'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(AudioMpeg::class, $this->type); } public function testIsAudio() { $this->assertTrue($this->type->isAudio()); } } tests/AudioMpegTest.php000064400000001214150731645730011142 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/mp3_id3v1'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(AudioMpeg::class, $this->type); } public function testIsAudio() { $this->assertTrue($this->type->isAudio()); } } tests/ImageAvifTest.php000064400000001214150731645730011120 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.avif'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageAvif::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageBmpTest.php000064400000001210150731645730010745 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.bmp'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageBmp::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageGifTest.php000064400000001210150731645730010734 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.gif'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageGif::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageHeicTest.php000064400000001207150731645730011105 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/heic'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageHeic::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageHeifTest.php000064400000001207150731645730011110 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/heif'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageHeif::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageIcoTest.php000064400000001210150731645730010741 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.ico'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageIco::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageJpegTest.php000064400000001213150731645730011117 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.jpg'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageJpeg::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImagePngTest.php000064400000001210150731645730010753 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.png'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImagePng::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImagePsdTest.php000064400000001203150731645730010757 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/psd'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImagePsd::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageSvgTest.php000064400000002242150731645730010774 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.svg'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageSvg::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } public function testPlainXmlIsNotSvg() { $sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.xml'); $this->assertInstanceOf(TextPlain::class, $sniffer->getType()); } public function testSvgWithoutXmlTag() { $sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/svg'); $this->assertInstanceOf(ImageSvg::class, $sniffer->getType()); } } tests/ImageTiffTest.php000064400000001207150731645730011125 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/tiff'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageTiff::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/ImageWebpTest.php000064400000001214150731645730011130 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.webp'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(ImageWebp::class, $this->type); } public function testIsImage() { $this->assertTrue($this->type->isImage()); } } tests/MimeSnifferTest.php000064400000005303150731645730011477 0ustar00assertInstanceOf(MimeSniffer::class, $sniffer); $sniffer = new MimeSniffer(); $this->assertInstanceOf(MimeSniffer::class, $sniffer); } public function testCreateFromString() { $sniffer = MimeSniffer::createFromString('foo'); $this->assertInstanceOf(MimeSniffer::class, $sniffer); } public function testCreateFromFilename() { $sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.jpg'); $this->assertInstanceOf(MimeSniffer::class, $sniffer); } public function testSetFromString() { $sniffer = new MimeSniffer(); $sniffer = $sniffer->setFromString('foo'); $this->assertInstanceOf(MimeSniffer::class, $sniffer); } public function testSetFromFilename() { $sniffer = new MimeSniffer(); $sniffer = $sniffer->setFromFilename(__DIR__ . '/../tests/stubs/zip'); $this->assertInstanceOf(MimeSniffer::class, $sniffer); } public function testMatchesType() { $sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.gif'); $this->assertTrue($sniffer->matches(new ImageGif())); $this->assertFalse($sniffer->matches(new ImageJpeg())); } public function testMatchesArray() { $sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/files/test.gif'); $this->assertTrue($sniffer->matches([new ImageJpeg(), new ImagePng(), new ImageGif()])); $this->assertFalse($sniffer->matches([new ImageJpeg(), new ImagePng()])); $this->assertTrue($sniffer->matches([ImageJpeg::class, ImagePng::class, ImageGif::class])); $this->assertFalse($sniffer->matches([ImageJpeg::class, ImagePng::class])); } public function testMatchesBogus() { $sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/zip'); $this->assertFalse($sniffer->matches('foo')); $this->assertFalse($sniffer->matches(['foo', 'bar'])); $this->assertFalse($sniffer->matches([])); $this->assertFalse($sniffer->matches(null)); $this->assertTrue($sniffer->matches(['foo', ApplicationZip::class])); } } tests/VideoMpegTest.php000064400000001360150731645730011151 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/mpeg-video'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(VideoMpeg::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } public function testIsVideo() { $this->assertTrue($this->type->isVideo()); } } tests/VideoXmatroskaTest.php000064400000001370150731645730012233 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/mkv'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(VideoXmatroska::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } public function testIsVideo() { $this->assertTrue($this->type->isVideo()); } } tests/VideoXmsvideoTest.php000064400000001365150731645730012064 0ustar00sniffer = MimeSniffer::createFromFilename(__DIR__ . '/../tests/stubs/avi'); $this->type = $this->sniffer->getType(); } public function testType() { $this->assertInstanceOf(VideoXmsvideo::class, $this->type); } public function testIsImage() { $this->assertFalse($this->type->isImage()); } public function testIsVideo() { $this->assertTrue($this->type->isVideo()); } } tests/files/test.avif000064400000000754150731645730010657 0ustar00ftypavifavifmif1miaf˜meta!hdlrpictpitm4ilocD@¼Ð8iinfinfeav01infeav01×iprp±ipcocolrnclx€ av1C�ispepixi8auxCurn:mpeg:mpegB:cicp:systems:auxiliary:alpha av1C� ispepixiipma�†ˆ‚„…irefauxl8mdat 62 (¡!£` 6 2 (¢„°V_@¤ë ütests/files/test.bin000064400000000400150731645730010466 0ustar00  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿtests/files/test.bmp000064400000001070150731645730010500 0ustar00BM86(  pppppppppppppppppppppppppppppppppppp`<  <`ppppppp T$$ Tppppp`$$`pppp<<pppp  pppppppppppp  pppp<<pppp`$$`ppppp T$$ Tppppppp`<  <`pppppppppppppppppppppppppppppppppppptests/files/test.gif000064400000001120150731645730010463 0ustar00GIF89aô9Kcÿ¦BO_EQ]mcIæ› jaK¹†$6zõžïefx«j쬺ÌË,ª¬ºÏYwY·x»oܽxù|½m™Uêóx«*­½VUUUîË«¶Ê¼~íêø|o•Ù⮯^²ªÌ«Ý]ef^«Åx»*ñ—ìÞ¿ÆÕYvfxººÍ«,¬»»á–eYvW‹¿n÷zùz÷^2Ï ¼x¬ª²Û«ª­²ÊñugмfÕúŸ½|=gŠÊÛ¼xõUfÕ–VÕfmâ³m»¯5y»²ü¯…êÏw»Íã6ñ[Ux«ÖUÕ^jë.ʲÚʺ³ÍYµf×çÙðóg�jóu^¯•UVÕÙ•›ufxñµmm[^²¶Í¿ãzómm^>uã32²Ú³3*«2Ê«­º¬øYfÕfWª¯u~W��·ÆÏw›²ÚÛ<ÝxÌ«ªË›z½[wUeµµ[W�2«+n½fÙîüÛÝŸÕwÆÌ÷VÕÝÕÕîê¶¶¯m]UÙW›½Ý_™ñ¼{½x÷xÛ+͵VmÕÕ]ž6êëkÅ••µg�²î­«»óoVy¼ßk¼ÛuvÝyªÌªÛl̪º¯<ÖVg›¼mß Çä|-¶øß+¶Ú»½]—UU•e••Y•m•⪼ÕÞì»k×àÙãáe·}=VÙµ›v]Y••·V[YUWvYvY·eÙUµâ³×»ðow»3ÍãÕÞ<ׯëÕe]]–m]UÕæ¬Ú«6®ùzÛÍãÍøŸO�ž®Û<Þ³j²«jêË«ºº«²Ë,Ì»«¶³ÍeÝòñü÷»ÕëÕ·mã<Ùvg›«j¶ÊÛÝfVVYãÅâ¯ãn²½ß™ñ³ÝæúÞ.ë*ìÛáuWvxª³n¬¬¬óYž*óvWšúÛ['Öúzù׊ڬËm¼]Õe|2ÊË,¬¬ñ—«³Ím^=Þo7Âõg¯xÏYx­»<׬ªÊ̲ÚÌʬ³ÆÖegŒ«2«.ͼzþ¯�îù^=zÛÅ™Ummž*³nõwU•y²õWx¯u^.«óï_/YëÝ{­¯Ymm]UYe·m^.®õ[e[VÕV]æó~Æûmæñxʬª¶Û,»¬»<ÝVU]·V]^l¯w^6³×äÞ¾_^îÛÍ•f|*Ì̽]VVÕž6­º¼m•ôÛçxõòøß/†y¶¼zñ™V[y¼^*³Ý—uUUe™ug�xË3,¼ßZñãø>7Ãm½Þ+2®¶êÌË+.®¶õY•™VfYeÛfxºËlÏw�^o^lñðñæÛǯ_ ª«ÇÎͪÏu™UUVx³33,¼g›¼Þïîø|lþº¼Ùµ—Ë*î®í¶î«k,»º««Õ|6ÛÅöøß[m½^îÛo�îø[uâënëöÞ¾ÖÞ=Þ+*îëkÖUU]x²ìʺ¶ì˲î̳jêìÏ­ó¯[ç|<|½Ý–][e–UVmeëj¬²ñ•–U–U›[Wy¾›zùÛmã×ñ}/›*˼]ÙUžlË*ªïfVÛfÞkl³o�™—›Ýîóy¶ÚÏvתñeÕ^3ÆUÕÕeµY•ž/•·Um—x˺¶ï7ÛÍîϽYãÍò÷^2¶®ñâ˺²Ë.ª«jªËmª¶î®ÚÚʪÏã¶ùÙý6Ý—›ÆxºÊ˶ïuU•mµ›Y·z²î¯Yæ«Æ[~�Áî÷|«ÅµµVx²Ë³Ç‹«º¶êʺʪñfÙYuv|oç¶Ï7÷ß ²²«=g¬«*³Ç‹º¬³Ç�™zËm¶¯�ð˼_/7�äñão7U–Öՙëo…egÃNJʬ̻6íªÛ×öy¿ øÞlͪ³*ʬ¬ÌñeUUeÙueÕ]m]•ãǯã¾ß ú¾7›ÍUÕz¬²ª«+eô¾·øûÍ]UW‹2¼[v]ךÊÊ­»íöó{¼”«¬ªË,Û³*¼y«kjë<ßËy»oô•—Yµæ«Í™eVx½gŠúÙü_oòÿÿÄÀÿÚ?jgÿÄ`p0€� @ÿÚ?±ß†^M–bG.d{¥ÈÜiïuÑ:I†Ÿ³¼Ã_™g/ ¾&6�†:z1Ødyè�æ.lcôc¯'.½3#ùÝFå&É>‰ÿÄÀÿÚ?jgÿÙtests/files/test.png000064400000000577150731645730010521 0ustar00‰PNG  IHDR22?ˆ±FIDATxÚíÚ=ªƒP†áã*ìÓÈ ² Á-¸ÁÂÊÆ*¥­+Ð=‚�Å,*o‘âr¹?’øw>ž|àñŒ3ãzDˆ‘£F‡ÓK�5rĈ`÷ç† ìM RÜöpG‰¶�%î[¸¢À[Ɉ×5HÐÂ6Ò"Yò …È`;É~â‚ ¶³ —OB<`ñx'Lˆ v0BÌ>Øì ²¹€vpÉœ{¢õ Hûß=SÀ>.?Ù rY Ý z - 1    Y j; !µ57%ˆtests/files/test.svg000064400000016243150731645730010531 0ustar00 tests/files/test.tar000064400000024000150731645730010506 0ustar00foo.json0000644000175000017500000000007613513647427012135 0ustar oliveroliver{ "require": { "intervention/image": "^1" } } tests/files/test.txt000064400000000004150731645730010535 0ustar00testtests/files/test.webp000064400000000314150731645730010657 0ustar00RIFFÄWEBPVP8 ¸Ð�*%°tºøøNøàèðÀ àÐ ð�Ò¿Ü€àÕnÀ6[—¬ˆ@þúïüÅ÷Štü7ËU'¡~L˜,Àò6•íhé{\¥Ý`Ì WÂiÚ+ÎPÿè\Ï); aè�hј §0ÞxÜ*Êl }!q>�”�PP ²ÚSDÿ쵨ٞ†\vC±Œû.Zˆ[ ‘ÿB% Ѽ2tests/files/test.xml000064400000000536150731645730010530 0ustar00 http://intervention.io/ tests/stubs/avi000064400000000020150731645730007553 0ustar00RIFFAVI tests/stubs/flac000064400000000010150731645730007700 0ustar00fLaCtests/stubs/gzip000064400000000003150731645730007746 0ustar00‹tests/stubs/heic000064400000000170150731645730007712 0ustar00 ftypheicmif1miafMiHBheic ¡meta"hdlrpict$dinfdref url pitests/stubs/heif000064400000000100150731645730007706 0ustar00ftypmif1mif1heicñmeta!hdlrpicttests/stubs/mkv000064400000000010150731645730007570 0ustar00Eߣtests/stubs/mp3_id3v1000064400000000004150731645730010503 0ustar00ÿûtests/stubs/mp3_id3v2000064400000000006150731645730010506 0ustar00ID3tests/stubs/mpeg-video000064400000000010150731645730011027 0ustar00³tests/stubs/ogg000064400000000010150731645730007547 0ustar00OggStests/stubs/pdf000064400000000006150731645730007551 0ustar00%PDF-tests/stubs/psd000064400000000005150731645730007565 0ustar008BPStests/stubs/rar000064400000000007150731645730007565 0ustar00Rar!tests/stubs/svg000064400000000227150731645730007604 0ustar00 tests/stubs/tiff000064400000000004150731645730007726 0ustar00II*tests/stubs/zip000064400000000004150731645730007600 0ustar00PK