├── .editorconfig ├── .gitignore ├── .nvmrc ├── .travis.yml ├── .wp-env.json ├── CHANGELOG.md ├── Gruntfile.js ├── README.md ├── bin └── install-wp-tests.sh ├── composer.json ├── composer.lock ├── package-lock.json ├── package.json ├── phpunit.xml.dist ├── readme.txt ├── src ├── globals.php ├── intervention-wrapper.php └── plugin.php ├── tests ├── bootstrap.php ├── images │ └── test.jpg └── test-sample.php ├── vendor ├── autoload.php ├── composer │ ├── ClassLoader.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_files.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ ├── autoload_static.php │ └── installed.json ├── guzzlehttp │ └── psr7 │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ ├── AppendStream.php │ │ ├── BufferStream.php │ │ ├── CachingStream.php │ │ ├── DroppingStream.php │ │ ├── FnStream.php │ │ ├── InflateStream.php │ │ ├── LazyOpenStream.php │ │ ├── LimitStream.php │ │ ├── MessageTrait.php │ │ ├── MultipartStream.php │ │ ├── NoSeekStream.php │ │ ├── PumpStream.php │ │ ├── Request.php │ │ ├── Response.php │ │ ├── ServerRequest.php │ │ ├── Stream.php │ │ ├── StreamDecoratorTrait.php │ │ ├── StreamWrapper.php │ │ ├── UploadedFile.php │ │ ├── Uri.php │ │ ├── functions.php │ │ └── functions_include.php ├── intervention │ └── image │ │ ├── LICENSE │ │ ├── composer.json │ │ ├── provides.json │ │ └── src │ │ ├── Intervention │ │ └── Image │ │ │ ├── AbstractColor.php │ │ │ ├── AbstractDecoder.php │ │ │ ├── AbstractDriver.php │ │ │ ├── AbstractEncoder.php │ │ │ ├── AbstractFont.php │ │ │ ├── AbstractShape.php │ │ │ ├── Commands │ │ │ ├── AbstractCommand.php │ │ │ ├── Argument.php │ │ │ ├── ChecksumCommand.php │ │ │ ├── CircleCommand.php │ │ │ ├── EllipseCommand.php │ │ │ ├── ExifCommand.php │ │ │ ├── IptcCommand.php │ │ │ ├── LineCommand.php │ │ │ ├── OrientateCommand.php │ │ │ ├── PolygonCommand.php │ │ │ ├── PsrResponseCommand.php │ │ │ ├── RectangleCommand.php │ │ │ ├── ResponseCommand.php │ │ │ ├── StreamCommand.php │ │ │ └── TextCommand.php │ │ │ ├── Constraint.php │ │ │ ├── Exception │ │ │ ├── InvalidArgumentException.php │ │ │ ├── MissingDependencyException.php │ │ │ ├── NotFoundException.php │ │ │ ├── NotReadableException.php │ │ │ ├── NotSupportedException.php │ │ │ ├── NotWritableException.php │ │ │ └── RuntimeException.php │ │ │ ├── Facades │ │ │ └── Image.php │ │ │ ├── File.php │ │ │ ├── Filters │ │ │ ├── DemoFilter.php │ │ │ └── FilterInterface.php │ │ │ ├── Gd │ │ │ ├── Color.php │ │ │ ├── Commands │ │ │ │ ├── BackupCommand.php │ │ │ │ ├── BlurCommand.php │ │ │ │ ├── BrightnessCommand.php │ │ │ │ ├── ColorizeCommand.php │ │ │ │ ├── ContrastCommand.php │ │ │ │ ├── CropCommand.php │ │ │ │ ├── DestroyCommand.php │ │ │ │ ├── FillCommand.php │ │ │ │ ├── FitCommand.php │ │ │ │ ├── FlipCommand.php │ │ │ │ ├── GammaCommand.php │ │ │ │ ├── GetSizeCommand.php │ │ │ │ ├── GreyscaleCommand.php │ │ │ │ ├── HeightenCommand.php │ │ │ │ ├── InsertCommand.php │ │ │ │ ├── InterlaceCommand.php │ │ │ │ ├── InvertCommand.php │ │ │ │ ├── LimitColorsCommand.php │ │ │ │ ├── MaskCommand.php │ │ │ │ ├── OpacityCommand.php │ │ │ │ ├── PickColorCommand.php │ │ │ │ ├── PixelCommand.php │ │ │ │ ├── PixelateCommand.php │ │ │ │ ├── ResetCommand.php │ │ │ │ ├── ResizeCanvasCommand.php │ │ │ │ ├── ResizeCommand.php │ │ │ │ ├── RotateCommand.php │ │ │ │ ├── SharpenCommand.php │ │ │ │ ├── TrimCommand.php │ │ │ │ └── WidenCommand.php │ │ │ ├── Decoder.php │ │ │ ├── Driver.php │ │ │ ├── Encoder.php │ │ │ ├── Font.php │ │ │ └── Shapes │ │ │ │ ├── CircleShape.php │ │ │ │ ├── EllipseShape.php │ │ │ │ ├── LineShape.php │ │ │ │ ├── PolygonShape.php │ │ │ │ └── RectangleShape.php │ │ │ ├── Image.php │ │ │ ├── ImageManager.php │ │ │ ├── ImageManagerStatic.php │ │ │ ├── ImageServiceProvider.php │ │ │ ├── ImageServiceProviderLaravel4.php │ │ │ ├── ImageServiceProviderLeague.php │ │ │ ├── ImageServiceProviderLumen.php │ │ │ ├── Imagick │ │ │ ├── Color.php │ │ │ ├── Commands │ │ │ │ ├── BackupCommand.php │ │ │ │ ├── BlurCommand.php │ │ │ │ ├── BrightnessCommand.php │ │ │ │ ├── ColorizeCommand.php │ │ │ │ ├── ContrastCommand.php │ │ │ │ ├── CropCommand.php │ │ │ │ ├── DestroyCommand.php │ │ │ │ ├── FillCommand.php │ │ │ │ ├── FitCommand.php │ │ │ │ ├── FlipCommand.php │ │ │ │ ├── GammaCommand.php │ │ │ │ ├── GetSizeCommand.php │ │ │ │ ├── GreyscaleCommand.php │ │ │ │ ├── HeightenCommand.php │ │ │ │ ├── InsertCommand.php │ │ │ │ ├── InterlaceCommand.php │ │ │ │ ├── InvertCommand.php │ │ │ │ ├── LimitColorsCommand.php │ │ │ │ ├── MaskCommand.php │ │ │ │ ├── OpacityCommand.php │ │ │ │ ├── PickColorCommand.php │ │ │ │ ├── PixelCommand.php │ │ │ │ ├── PixelateCommand.php │ │ │ │ ├── ResetCommand.php │ │ │ │ ├── ResizeCanvasCommand.php │ │ │ │ ├── ResizeCommand.php │ │ │ │ ├── RotateCommand.php │ │ │ │ ├── SharpenCommand.php │ │ │ │ ├── TrimCommand.php │ │ │ │ └── WidenCommand.php │ │ │ ├── Decoder.php │ │ │ ├── Driver.php │ │ │ ├── Encoder.php │ │ │ ├── Font.php │ │ │ └── Shapes │ │ │ │ ├── CircleShape.php │ │ │ │ ├── EllipseShape.php │ │ │ │ ├── LineShape.php │ │ │ │ ├── PolygonShape.php │ │ │ │ └── RectangleShape.php │ │ │ ├── Point.php │ │ │ ├── Response.php │ │ │ └── Size.php │ │ └── config │ │ └── config.php ├── psr │ └── http-message │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ ├── MessageInterface.php │ │ ├── RequestInterface.php │ │ ├── ResponseInterface.php │ │ ├── ServerRequestInterface.php │ │ ├── StreamInterface.php │ │ ├── UploadedFileInterface.php │ │ └── UriInterface.php └── symfony │ ├── polyfill-mbstring │ ├── LICENSE │ ├── Mbstring.php │ ├── README.md │ ├── Resources │ │ └── unidata │ │ │ ├── lowerCase.php │ │ │ └── upperCase.php │ ├── bootstrap.php │ └── composer.json │ └── var-dumper │ ├── CHANGELOG.md │ ├── Caster │ ├── AmqpCaster.php │ ├── Caster.php │ ├── ConstStub.php │ ├── CutArrayStub.php │ ├── CutStub.php │ ├── DOMCaster.php │ ├── DoctrineCaster.php │ ├── EnumStub.php │ ├── ExceptionCaster.php │ ├── FrameStub.php │ ├── PdoCaster.php │ ├── PgSqlCaster.php │ ├── ReflectionCaster.php │ ├── ResourceCaster.php │ ├── SplCaster.php │ ├── StubCaster.php │ ├── TraceStub.php │ └── XmlResourceCaster.php │ ├── Cloner │ ├── AbstractCloner.php │ ├── ClonerInterface.php │ ├── Cursor.php │ ├── Data.php │ ├── DumperInterface.php │ ├── Stub.php │ └── VarCloner.php │ ├── Dumper │ ├── AbstractDumper.php │ ├── CliDumper.php │ ├── DataDumperInterface.php │ └── HtmlDumper.php │ ├── Exception │ └── ThrowingCasterException.php │ ├── LICENSE │ ├── README.md │ ├── Resources │ └── functions │ │ └── dump.php │ ├── Test │ └── VarDumperTestTrait.php │ ├── VarDumper.php │ └── composer.json └── wp-intervention.php /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | # WordPress Coding Standards 5 | # https://make.wordpress.org/core/handbook/coding-standards/ 6 | 7 | root = true 8 | 9 | [*] 10 | charset = utf-8 11 | end_of_line = lf 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | indent_style = tab 15 | indent_size = 4 16 | 17 | [{.jshintrc,*.json,*.yml}] 18 | indent_style = space 19 | indent_size = 2 20 | 21 | [{*.txt,wp-config-sample.php}] 22 | end_of_line = crlf 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | 4 | # Vendor itself is not ignored because 5 | vendor/ 6 | !vendor/intervention 7 | !vendor/composer 8 | !vendor/autoload.php -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/* 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | notifications: 4 | email: 5 | on_success: never 6 | on_failure: change 7 | 8 | branches: 9 | only: 10 | - master 11 | 12 | php: 13 | - 5.3 14 | - 5.6 15 | 16 | env: 17 | - WP_VERSION=latest WP_MULTISITE=0 18 | - WP_VERSION=3.0.1 WP_MULTISITE=0 19 | - WP_VERSION=3.4 WP_MULTISITE=0 20 | 21 | matrix: 22 | include: 23 | - php: 5.3 24 | env: WP_VERSION=latest WP_MULTISITE=1 25 | 26 | before_script: 27 | - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION 28 | 29 | script: phpunit 30 | -------------------------------------------------------------------------------- /.wp-env.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "./" 4 | ], 5 | "port": 5567, 6 | "testsPort": 5568, 7 | "config": { 8 | "WP_DEBUG": true, 9 | "WP_DEBUG_DISPLAY": true, 10 | "SCRIPT_DEBUG": true 11 | } 12 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | For more information about keeping good change logs please refer to [keep a changelog](https://github.com/olivierlacan/keep-a-changelog). 6 | 7 | ## Changelog 8 | 9 | ## [1.1.0] 10 | 11 | ### Added 12 | * Introduced ability to return underlying Intervention.io instance for non-cached requests. 13 | 14 | ### Fixed 15 | * Fixed major performance issue with caching logic whereby the Intervention lib was being initialised even if file was in cache. Reverted to using raw PHP and significantly improved performance. 16 | 17 | ## [1.0.3] 18 | 19 | ### Changed 20 | * Set composer installs to use `*` as version. 21 | 22 | ## [1.0.0] 23 | 24 | Initial full release of the Plugin. -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function( grunt ) { 2 | 3 | 'use strict'; 4 | var banner = '/**\n * <%= pkg.homepage %>\n * Copyright (c) <%= grunt.template.today("yyyy") %>\n * This file is generated automatically. Do not edit.\n */\n'; 5 | // Project configuration 6 | grunt.initConfig( { 7 | 8 | pkg: grunt.file.readJSON( 'package.json' ), 9 | 10 | addtextdomain: { 11 | options: { 12 | textdomain: 'wp-intervention', 13 | }, 14 | target: { 15 | files: { 16 | src: [ '*.php', '**/*.php', '!node_modules/**', '!php-tests/**', '!bin/**' ] 17 | } 18 | } 19 | }, 20 | 21 | wp_readme_to_markdown: { 22 | your_target: { 23 | files: { 24 | 'README.md': 'readme.txt' 25 | } 26 | }, 27 | }, 28 | 29 | makepot: { 30 | target: { 31 | options: { 32 | domainPath: '/languages', 33 | mainFile: 'wp-intervention.php', 34 | potFilename: 'wp-intervention.pot', 35 | potHeaders: { 36 | poedit: true, 37 | 'x-poedit-keywordslist': true 38 | }, 39 | type: 'wp-plugin', 40 | updateTimestamp: true 41 | } 42 | } 43 | }, 44 | } ); 45 | 46 | grunt.loadNpmTasks( 'grunt-wp-i18n' ); 47 | grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' ); 48 | grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] ); 49 | grunt.registerTask( 'readme', ['wp_readme_to_markdown'] ); 50 | 51 | grunt.util.linefeed = '\n'; 52 | 53 | }; 54 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getdave/wp-intervention", 3 | "description": "WP Intervention provides on-demand image manipulation for WordPress via the Intervention Library", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "David Smith", 8 | "email": "getdavemail@gmail.com", 9 | "homepage": "https://aheadcreative.co.uk" 10 | } 11 | ], 12 | "type": "wordpress-plugin", 13 | "require": { 14 | "intervention/image": "^2.5", 15 | "composer/installers": "*" 16 | }, 17 | "require-dev": { 18 | "symfony/var-dumper": "*", 19 | "php-mock/php-mock-phpunit": "*" 20 | }, 21 | "autoload": { 22 | "files": [ 23 | "src/plugin.php", 24 | "src/intervention-wrapper.php", 25 | "src/globals.php" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-intervention", 3 | "version": "0.0.0", 4 | "main": "Gruntfile.js", 5 | "author": "David Smith", 6 | "devDependencies": { 7 | "@wordpress/env": "^1.0.1", 8 | "grunt": "^1.1.0", 9 | "grunt-wp-i18n": "^1.0.3", 10 | "grunt-wp-readme-to-markdown": "^2.0.1", 11 | "minimist": "^1.2.5" 12 | }, 13 | "scripts": { 14 | "preenv:*": "nvm install lts/* && nvm use", 15 | "env:start": "npx wp-env start", 16 | "env:stop": "npx wp-env stop" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | ./tests/ 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/globals.php: -------------------------------------------------------------------------------- 1 | process($return_instance); 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/plugin.php: -------------------------------------------------------------------------------- 1 | basename = plugin_basename( $file ); 23 | $this->loaded = false; 24 | } 25 | 26 | /** 27 | * Loads the plugin into WordPress. 28 | * Only allows this to happen once. 29 | */ 30 | public function load() { 31 | if ( $this->loaded ) { 32 | return; 33 | } 34 | 35 | $this->loaded = true; 36 | 37 | // Add actions... 38 | $this->add_actions(); 39 | 40 | // Create the cache dir if it doesn't exist 41 | $this->make_cache_dir(); 42 | } 43 | 44 | private function add_actions() { 45 | add_action( 'wpi_clean_cache', array( $this, 'remove_outdated_cache_files' ) ); 46 | 47 | add_action( 'switch_blog', array( $this, 'clear_upload_dir_cache' ) ); 48 | } 49 | 50 | 51 | 52 | public static function get_cache_dir() { 53 | 54 | if ( empty( static::$cache_dir ) ) { 55 | 56 | $uploads_info = wp_upload_dir(); 57 | $rtn = $uploads_info['basedir'] . '/intervention/cache/'; 58 | 59 | // Allow overide by devs... 60 | static::$cache_dir = apply_filters( 'wpi_cache_directory', $rtn ); 61 | } 62 | 63 | return static::$cache_dir; 64 | } 65 | 66 | private function make_cache_dir() { 67 | wp_mkdir_p( static::get_cache_dir() ); 68 | } 69 | 70 | // Cron Tab to remove outdated cache files 71 | public function remove_outdated_cache_files() { 72 | 73 | // TODO - make cache dir a filterable option on this core class not on the Lib Wrapper 74 | $dir = static::get_cache_dir(); 75 | 76 | /*** cycle through all files in the directory */ 77 | foreach ( glob( $dir . '*' ) as $file ) { 78 | 79 | /*** if file is 24 hours (86400 seconds) old then delete it */ 80 | if ( filemtime( $file ) < time() - apply_filters( 'wpi_clean_outdate_cache_files_period', 86400 ) ) { 81 | unlink( $file ); 82 | } 83 | } 84 | } 85 | 86 | public static function upload_dir() { 87 | if ( empty( self::$wp_upload_dir ) ) { 88 | self::$wp_upload_dir = wp_upload_dir(); 89 | } 90 | return self::$wp_upload_dir; 91 | } 92 | 93 | public static function clear_upload_dir_cache() { 94 | self::$wp_upload_dir = null; 95 | } 96 | 97 | public static function activated() { 98 | wp_schedule_event( time(), apply_filters( 'wpi_clean_outdate_cache_files_cron_recurrance', 'hourly' ), 'wpi_clean_cache' ); 99 | } 100 | 101 | public static function deactivated() { 102 | wp_clear_scheduled_hook( 'wpi_clean_cache' ); 103 | } 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | assertTrue( function_exists( 'wp_intervention' ), 'Global helper function defined' ); 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', 10 | '9e7a8ca9c2c682ec2704dd873a0e3618' => $vendorDir . '/php-mock/php-mock/autoload.php', 11 | '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 12 | '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', 13 | 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 14 | '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', 15 | '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 16 | '125bba9b2a34259a2ab4c8f405781876' => $vendorDir . '/php-mock/php-mock-phpunit/autoload.php', 17 | '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 18 | 'a62ac72e328e3d4b33ed468b4d61f53d' => $baseDir . '/src/plugin.php', 19 | 'c4520504243ef15bb63d1a84497082dd' => $baseDir . '/src/intervention-wrapper.php', 20 | 'ae56fa577af8b0644973b323e91e2e33' => $baseDir . '/src/globals.php', 21 | ); 22 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/php-mock/php-mock-phpunit/classes'), 10 | 'phpmock\\integration\\' => array($vendorDir . '/php-mock/php-mock-integration/classes'), 11 | 'phpmock\\' => array($vendorDir . '/php-mock/php-mock/classes', $vendorDir . '/php-mock/php-mock/tests'), 12 | 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'), 13 | 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 14 | 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 15 | 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), 16 | 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), 17 | 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 18 | 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'), 19 | 'Intervention\\Image\\' => array($vendorDir . '/intervention/image/src/Intervention/Image'), 20 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 21 | 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), 22 | 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 23 | 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), 24 | ); 25 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInit014b6ab071b4a2d341f60a1ed5c54e80::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | if ($useStaticLoader) { 51 | $includeFiles = Composer\Autoload\ComposerStaticInit014b6ab071b4a2d341f60a1ed5c54e80::$files; 52 | } else { 53 | $includeFiles = require __DIR__ . '/autoload_files.php'; 54 | } 55 | foreach ($includeFiles as $fileIdentifier => $file) { 56 | composerRequire014b6ab071b4a2d341f60a1ed5c54e80($fileIdentifier, $file); 57 | } 58 | 59 | return $loader; 60 | } 61 | } 62 | 63 | function composerRequire014b6ab071b4a2d341f60a1ed5c54e80($fileIdentifier, $file) 64 | { 65 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 66 | require $file; 67 | 68 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/psr7", 3 | "type": "library", 4 | "description": "PSR-7 message implementation that also provides common utility methods", 5 | "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Michael Dowling", 10 | "email": "mtdowling@gmail.com", 11 | "homepage": "https://github.com/mtdowling" 12 | }, 13 | { 14 | "name": "Tobias Schultze", 15 | "homepage": "https://github.com/Tobion" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "psr/http-message": "~1.0", 21 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8", 25 | "ext-zlib": "*" 26 | }, 27 | "provide": { 28 | "psr/http-message-implementation": "1.0" 29 | }, 30 | "suggest": { 31 | "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "GuzzleHttp\\Psr7\\": "src/" 36 | }, 37 | "files": ["src/functions_include.php"] 38 | }, 39 | "autoload-dev": { 40 | "psr-4": { 41 | "GuzzleHttp\\Tests\\Psr7\\": "tests/" 42 | } 43 | }, 44 | "extra": { 45 | "branch-alias": { 46 | "dev-master": "1.6-dev" 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/BufferStream.php: -------------------------------------------------------------------------------- 1 | hwm = $hwm; 29 | } 30 | 31 | public function __toString() 32 | { 33 | return $this->getContents(); 34 | } 35 | 36 | public function getContents() 37 | { 38 | $buffer = $this->buffer; 39 | $this->buffer = ''; 40 | 41 | return $buffer; 42 | } 43 | 44 | public function close() 45 | { 46 | $this->buffer = ''; 47 | } 48 | 49 | public function detach() 50 | { 51 | $this->close(); 52 | } 53 | 54 | public function getSize() 55 | { 56 | return strlen($this->buffer); 57 | } 58 | 59 | public function isReadable() 60 | { 61 | return true; 62 | } 63 | 64 | public function isWritable() 65 | { 66 | return true; 67 | } 68 | 69 | public function isSeekable() 70 | { 71 | return false; 72 | } 73 | 74 | public function rewind() 75 | { 76 | $this->seek(0); 77 | } 78 | 79 | public function seek($offset, $whence = SEEK_SET) 80 | { 81 | throw new \RuntimeException('Cannot seek a BufferStream'); 82 | } 83 | 84 | public function eof() 85 | { 86 | return strlen($this->buffer) === 0; 87 | } 88 | 89 | public function tell() 90 | { 91 | throw new \RuntimeException('Cannot determine the position of a BufferStream'); 92 | } 93 | 94 | /** 95 | * Reads data from the buffer. 96 | */ 97 | public function read($length) 98 | { 99 | $currentLength = strlen($this->buffer); 100 | 101 | if ($length >= $currentLength) { 102 | // No need to slice the buffer because we don't have enough data. 103 | $result = $this->buffer; 104 | $this->buffer = ''; 105 | } else { 106 | // Slice up the result to provide a subset of the buffer. 107 | $result = substr($this->buffer, 0, $length); 108 | $this->buffer = substr($this->buffer, $length); 109 | } 110 | 111 | return $result; 112 | } 113 | 114 | /** 115 | * Writes data to the buffer. 116 | */ 117 | public function write($string) 118 | { 119 | $this->buffer .= $string; 120 | 121 | // TODO: What should happen here? 122 | if (strlen($this->buffer) >= $this->hwm) { 123 | return false; 124 | } 125 | 126 | return strlen($string); 127 | } 128 | 129 | public function getMetadata($key = null) 130 | { 131 | if ($key == 'hwm') { 132 | return $this->hwm; 133 | } 134 | 135 | return $key ? null : []; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/DroppingStream.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 23 | $this->maxLength = $maxLength; 24 | } 25 | 26 | public function write($string) 27 | { 28 | $diff = $this->maxLength - $this->stream->getSize(); 29 | 30 | // Begin returning 0 when the underlying stream is too large. 31 | if ($diff <= 0) { 32 | return 0; 33 | } 34 | 35 | // Write the stream or a subset of the stream if needed. 36 | if (strlen($string) < $diff) { 37 | return $this->stream->write($string); 38 | } 39 | 40 | return $this->stream->write(substr($string, 0, $diff)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/InflateStream.php: -------------------------------------------------------------------------------- 1 | read(10); 25 | $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); 26 | // Skip the header, that is 10 + length of filename + 1 (nil) bytes 27 | $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); 28 | $resource = StreamWrapper::getResource($stream); 29 | stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); 30 | $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); 31 | } 32 | 33 | /** 34 | * @param StreamInterface $stream 35 | * @param $header 36 | * @return int 37 | */ 38 | private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) 39 | { 40 | $filename_header_length = 0; 41 | 42 | if (substr(bin2hex($header), 6, 2) === '08') { 43 | // we have a filename, read until nil 44 | $filename_header_length = 1; 45 | while ($stream->read(1) !== chr(0)) { 46 | $filename_header_length++; 47 | } 48 | } 49 | 50 | return $filename_header_length; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/LazyOpenStream.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 27 | $this->mode = $mode; 28 | } 29 | 30 | /** 31 | * Creates the underlying stream lazily when required. 32 | * 33 | * @return StreamInterface 34 | */ 35 | protected function createStream() 36 | { 37 | return stream_for(try_fopen($this->filename, $this->mode)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/NoSeekStream.php: -------------------------------------------------------------------------------- 1 | =5.4.0", 16 | "ext-fileinfo": "*", 17 | "guzzlehttp/psr7": "~1.1" 18 | }, 19 | "require-dev": { 20 | "phpunit/phpunit": "^4.8 || ^5.7", 21 | "mockery/mockery": "~0.9.2" 22 | }, 23 | "suggest": { 24 | "ext-gd": "to use GD library based image processing.", 25 | "ext-imagick": "to use Imagick based image processing.", 26 | "intervention/imagecache": "Caching extension for the Intervention Image library" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Intervention\\Image\\": "src/Intervention/Image" 31 | } 32 | }, 33 | "extra": { 34 | "branch-alias": { 35 | "dev-master": "2.4-dev" 36 | }, 37 | "laravel": { 38 | "providers": [ 39 | "Intervention\\Image\\ImageServiceProvider" 40 | ], 41 | "aliases": { 42 | "Image": "Intervention\\Image\\Facades\\Image" 43 | } 44 | } 45 | }, 46 | "minimum-stability": "stable" 47 | } 48 | -------------------------------------------------------------------------------- /vendor/intervention/image/provides.json: -------------------------------------------------------------------------------- 1 | { 2 | "providers": [ 3 | "Intervention\\Image\\ImageServiceProvider" 4 | ], 5 | "aliases": [ 6 | { 7 | "alias": "Image", 8 | "facade": "Intervention\\Image\\Facades\\Image" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/AbstractShape.php: -------------------------------------------------------------------------------- 1 | background = $color; 47 | } 48 | 49 | /** 50 | * Set border width and color of current shape 51 | * 52 | * @param int $width 53 | * @param string $color 54 | * @return void 55 | */ 56 | public function border($width, $color = null) 57 | { 58 | $this->border_width = is_numeric($width) ? intval($width) : 0; 59 | $this->border_color = is_null($color) ? '#000000' : $color; 60 | } 61 | 62 | /** 63 | * Determines if current shape has border 64 | * 65 | * @return boolean 66 | */ 67 | public function hasBorder() 68 | { 69 | return ($this->border_width >= 1); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/AbstractCommand.php: -------------------------------------------------------------------------------- 1 | arguments = $arguments; 39 | } 40 | 41 | /** 42 | * Creates new argument instance from given argument key 43 | * 44 | * @param int $key 45 | * @return \Intervention\Image\Commands\Argument 46 | */ 47 | public function argument($key) 48 | { 49 | return new Argument($this, $key); 50 | } 51 | 52 | /** 53 | * Returns output data of current command 54 | * 55 | * @return mixed 56 | */ 57 | public function getOutput() 58 | { 59 | return $this->output ? $this->output : null; 60 | } 61 | 62 | /** 63 | * Determines if current instance has output data 64 | * 65 | * @return boolean 66 | */ 67 | public function hasOutput() 68 | { 69 | return ! is_null($this->output); 70 | } 71 | 72 | /** 73 | * Sets output data of current command 74 | * 75 | * @param mixed $value 76 | */ 77 | public function setOutput($value) 78 | { 79 | $this->output = $value; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/ChecksumCommand.php: -------------------------------------------------------------------------------- 1 | getSize(); 18 | 19 | for ($x=0; $x <= ($size->width-1); $x++) { 20 | for ($y=0; $y <= ($size->height-1); $y++) { 21 | $colors[] = $image->pickColor($x, $y, 'array'); 22 | } 23 | } 24 | 25 | $this->setOutput(md5(serialize($colors))); 26 | 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/CircleCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 18 | $x = $this->argument(1)->type('numeric')->required()->value(); 19 | $y = $this->argument(2)->type('numeric')->required()->value(); 20 | $callback = $this->argument(3)->type('closure')->value(); 21 | 22 | $circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape', 23 | $image->getDriver()->getDriverName()); 24 | 25 | $circle = new $circle_classname($diameter); 26 | 27 | if ($callback instanceof Closure) { 28 | $callback($circle); 29 | } 30 | 31 | $circle->applyToImage($image, $x, $y); 32 | 33 | return true; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/EllipseCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 18 | $height = $this->argument(1)->type('numeric')->required()->value(); 19 | $x = $this->argument(2)->type('numeric')->required()->value(); 20 | $y = $this->argument(3)->type('numeric')->required()->value(); 21 | $callback = $this->argument(4)->type('closure')->value(); 22 | 23 | $ellipse_classname = sprintf('\Intervention\Image\%s\Shapes\EllipseShape', 24 | $image->getDriver()->getDriverName()); 25 | 26 | $ellipse = new $ellipse_classname($width, $height); 27 | 28 | if ($callback instanceof Closure) { 29 | $callback($ellipse); 30 | } 31 | 32 | $ellipse->applyToImage($image, $x, $y); 33 | 34 | return true; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/ExifCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 28 | 29 | // try to read exif data from image file 30 | try { 31 | $data = @exif_read_data($image->dirname . '/' . $image->basename); 32 | 33 | if (!is_null($key) && is_array($data)) { 34 | $data = array_key_exists($key, $data) ? $data[$key] : false; 35 | } 36 | 37 | } catch (\Exception $e) { 38 | throw new NotReadableException( 39 | sprintf( 40 | "Cannot read the Exif data from the filename (%s) provided ", 41 | $image->dirname . '/' . $image->basename 42 | ), 43 | $e->getCode(), 44 | $e 45 | ); 46 | } 47 | 48 | $this->setOutput($data); 49 | return true; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/IptcCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 24 | 25 | $info = []; 26 | @getimagesize($image->dirname .'/'. $image->basename, $info); 27 | 28 | $data = []; 29 | 30 | if (array_key_exists('APP13', $info)) { 31 | $iptc = iptcparse($info['APP13']); 32 | 33 | if (is_array($iptc)) { 34 | $data['DocumentTitle'] = isset($iptc["2#005"][0]) ? $iptc["2#005"][0] : null; 35 | $data['Urgency'] = isset($iptc["2#010"][0]) ? $iptc["2#010"][0] : null; 36 | $data['Category'] = isset($iptc["2#015"][0]) ? $iptc["2#015"][0] : null; 37 | $data['Subcategories'] = isset($iptc["2#020"][0]) ? $iptc["2#020"][0] : null; 38 | $data['Keywords'] = isset($iptc["2#025"][0]) ? $iptc["2#025"] : null; 39 | $data['SpecialInstructions'] = isset($iptc["2#040"][0]) ? $iptc["2#040"][0] : null; 40 | $data['CreationDate'] = isset($iptc["2#055"][0]) ? $iptc["2#055"][0] : null; 41 | $data['CreationTime'] = isset($iptc["2#060"][0]) ? $iptc["2#060"][0] : null; 42 | $data['AuthorByline'] = isset($iptc["2#080"][0]) ? $iptc["2#080"][0] : null; 43 | $data['AuthorTitle'] = isset($iptc["2#085"][0]) ? $iptc["2#085"][0] : null; 44 | $data['City'] = isset($iptc["2#090"][0]) ? $iptc["2#090"][0] : null; 45 | $data['SubLocation'] = isset($iptc["2#092"][0]) ? $iptc["2#092"][0] : null; 46 | $data['State'] = isset($iptc["2#095"][0]) ? $iptc["2#095"][0] : null; 47 | $data['Country'] = isset($iptc["2#101"][0]) ? $iptc["2#101"][0] : null; 48 | $data['OTR'] = isset($iptc["2#103"][0]) ? $iptc["2#103"][0] : null; 49 | $data['Headline'] = isset($iptc["2#105"][0]) ? $iptc["2#105"][0] : null; 50 | $data['Source'] = isset($iptc["2#110"][0]) ? $iptc["2#110"][0] : null; 51 | $data['PhotoSource'] = isset($iptc["2#115"][0]) ? $iptc["2#115"][0] : null; 52 | $data['Copyright'] = isset($iptc["2#116"][0]) ? $iptc["2#116"][0] : null; 53 | $data['Caption'] = isset($iptc["2#120"][0]) ? $iptc["2#120"][0] : null; 54 | $data['CaptionWriter'] = isset($iptc["2#122"][0]) ? $iptc["2#122"][0] : null; 55 | } 56 | } 57 | 58 | if (! is_null($key) && is_array($data)) { 59 | $data = array_key_exists($key, $data) ? $data[$key] : false; 60 | } 61 | 62 | $this->setOutput($data); 63 | 64 | return true; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/LineCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 18 | $y1 = $this->argument(1)->type('numeric')->required()->value(); 19 | $x2 = $this->argument(2)->type('numeric')->required()->value(); 20 | $y2 = $this->argument(3)->type('numeric')->required()->value(); 21 | $callback = $this->argument(4)->type('closure')->value(); 22 | 23 | $line_classname = sprintf('\Intervention\Image\%s\Shapes\LineShape', 24 | $image->getDriver()->getDriverName()); 25 | 26 | $line = new $line_classname($x2, $y2); 27 | 28 | if ($callback instanceof Closure) { 29 | $callback($line); 30 | } 31 | 32 | $line->applyToImage($image, $x1, $y1); 33 | 34 | return true; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/OrientateCommand.php: -------------------------------------------------------------------------------- 1 | exif('Orientation')) { 16 | 17 | case 2: 18 | $image->flip(); 19 | break; 20 | 21 | case 3: 22 | $image->rotate(180); 23 | break; 24 | 25 | case 4: 26 | $image->rotate(180)->flip(); 27 | break; 28 | 29 | case 5: 30 | $image->rotate(270)->flip(); 31 | break; 32 | 33 | case 6: 34 | $image->rotate(270); 35 | break; 36 | 37 | case 7: 38 | $image->rotate(90)->flip(); 39 | break; 40 | 41 | case 8: 42 | $image->rotate(90); 43 | break; 44 | } 45 | 46 | return true; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/PolygonCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('array')->required()->value(); 19 | $callback = $this->argument(1)->type('closure')->value(); 20 | 21 | $vertices_count = count($points); 22 | 23 | // check if number if coordinates is even 24 | if ($vertices_count % 2 !== 0) { 25 | throw new InvalidArgumentException( 26 | "The number of given polygon vertices must be even." 27 | ); 28 | } 29 | 30 | if ($vertices_count < 6) { 31 | throw new InvalidArgumentException( 32 | "You must have at least 3 points in your array." 33 | ); 34 | } 35 | 36 | $polygon_classname = sprintf('\Intervention\Image\%s\Shapes\PolygonShape', 37 | $image->getDriver()->getDriverName()); 38 | 39 | $polygon = new $polygon_classname($points); 40 | 41 | if ($callback instanceof Closure) { 42 | $callback($polygon); 43 | } 44 | 45 | $polygon->applyToImage($image); 46 | 47 | return true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/PsrResponseCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 24 | $quality = $this->argument(1)->between(0, 100)->value(); 25 | 26 | //Encoded property will be populated at this moment 27 | $stream = $image->stream($format, $quality); 28 | 29 | $mimetype = finfo_buffer( 30 | finfo_open(FILEINFO_MIME_TYPE), 31 | $image->getEncoded() 32 | ); 33 | 34 | $this->setOutput(new Response( 35 | 200, 36 | [ 37 | 'Content-Type' => $mimetype, 38 | 'Content-Length' => strlen($image->getEncoded()) 39 | ], 40 | $stream 41 | )); 42 | 43 | return true; 44 | } 45 | } -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/RectangleCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 18 | $y1 = $this->argument(1)->type('numeric')->required()->value(); 19 | $x2 = $this->argument(2)->type('numeric')->required()->value(); 20 | $y2 = $this->argument(3)->type('numeric')->required()->value(); 21 | $callback = $this->argument(4)->type('closure')->value(); 22 | 23 | $rectangle_classname = sprintf('\Intervention\Image\%s\Shapes\RectangleShape', 24 | $image->getDriver()->getDriverName()); 25 | 26 | $rectangle = new $rectangle_classname($x1, $y1, $x2, $y2); 27 | 28 | if ($callback instanceof Closure) { 29 | $callback($rectangle); 30 | } 31 | 32 | $rectangle->applyToImage($image, $x1, $y1); 33 | 34 | return true; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/ResponseCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | $quality = $this->argument(1)->between(0, 100)->value(); 19 | 20 | $response = new Response($image, $format, $quality); 21 | 22 | $this->setOutput($response->make()); 23 | 24 | return true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/StreamCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 17 | $quality = $this->argument(1)->between(0, 100)->value(); 18 | 19 | $this->setOutput(\GuzzleHttp\Psr7\stream_for( 20 | $image->encode($format, $quality)->getEncoded() 21 | )); 22 | 23 | return true; 24 | } 25 | } -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Commands/TextCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->required()->value(); 17 | $x = $this->argument(1)->type('numeric')->value(0); 18 | $y = $this->argument(2)->type('numeric')->value(0); 19 | $callback = $this->argument(3)->type('closure')->value(); 20 | 21 | $fontclassname = sprintf('\Intervention\Image\%s\Font', 22 | $image->getDriver()->getDriverName()); 23 | 24 | $font = new $fontclassname($text); 25 | 26 | if ($callback instanceof Closure) { 27 | $callback($font); 28 | } 29 | 30 | $font->applyToImage($image, $x, $y); 31 | 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Constraint.php: -------------------------------------------------------------------------------- 1 | size = $size; 39 | } 40 | 41 | /** 42 | * Returns current size of constraint 43 | * 44 | * @return \Intervention\Image\Size 45 | */ 46 | public function getSize() 47 | { 48 | return $this->size; 49 | } 50 | 51 | /** 52 | * Fix the given argument in current constraint 53 | * 54 | * @param int $type 55 | * @return void 56 | */ 57 | public function fix($type) 58 | { 59 | $this->fixed = ($this->fixed & ~(1 << $type)) | (1 << $type); 60 | } 61 | 62 | /** 63 | * Checks if given argument is fixed in current constraint 64 | * 65 | * @param int $type 66 | * @return boolean 67 | */ 68 | public function isFixed($type) 69 | { 70 | return (bool) ($this->fixed & (1 << $type)); 71 | } 72 | 73 | /** 74 | * Fixes aspect ratio in current constraint 75 | * 76 | * @return void 77 | */ 78 | public function aspectRatio() 79 | { 80 | $this->fix(self::ASPECTRATIO); 81 | } 82 | 83 | /** 84 | * Fixes possibility to size up in current constraint 85 | * 86 | * @return void 87 | */ 88 | public function upsize() 89 | { 90 | $this->fix(self::UPSIZE); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Exception/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | dirname = array_key_exists('dirname', $info) ? $info['dirname'] : null; 51 | $this->basename = array_key_exists('basename', $info) ? $info['basename'] : null; 52 | $this->extension = array_key_exists('extension', $info) ? $info['extension'] : null; 53 | $this->filename = array_key_exists('filename', $info) ? $info['filename'] : null; 54 | 55 | if (file_exists($path) && is_file($path)) { 56 | $this->mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); 57 | } 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Get file size 64 | * 65 | * @return mixed 66 | */ 67 | public function filesize() 68 | { 69 | $path = $this->basePath(); 70 | 71 | if (file_exists($path) && is_file($path)) { 72 | return filesize($path); 73 | } 74 | 75 | return false; 76 | } 77 | 78 | /** 79 | * Get fully qualified path 80 | * 81 | * @return string 82 | */ 83 | public function basePath() 84 | { 85 | if ($this->dirname && $this->basename) { 86 | return ($this->dirname .'/'. $this->basename); 87 | } 88 | 89 | return null; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Filters/DemoFilter.php: -------------------------------------------------------------------------------- 1 | size = is_numeric($size) ? intval($size) : self::DEFAULT_SIZE; 29 | } 30 | 31 | /** 32 | * Applies filter effects to given image 33 | * 34 | * @param \Intervention\Image\Image $image 35 | * @return \Intervention\Image\Image 36 | */ 37 | public function applyFilter(Image $image) 38 | { 39 | $image->pixelate($this->size); 40 | $image->greyscale(); 41 | 42 | return $image; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Filters/FilterInterface.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | 19 | // clone current image resource 20 | $clone = clone $image; 21 | $image->setBackup($clone->getCore(), $backupName); 22 | 23 | return true; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/BlurCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(0, 100)->value(1); 18 | 19 | for ($i=0; $i < intval($amount); $i++) { 20 | imagefilter($image->getCore(), IMG_FILTER_GAUSSIAN_BLUR); 21 | } 22 | 23 | return true; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/BrightnessCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(-100, 100)->required()->value(); 18 | 19 | return imagefilter($image->getCore(), IMG_FILTER_BRIGHTNESS, ($level * 2.55)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/ColorizeCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(-100, 100)->required()->value(); 18 | $green = $this->argument(1)->between(-100, 100)->required()->value(); 19 | $blue = $this->argument(2)->between(-100, 100)->required()->value(); 20 | 21 | // normalize colorize levels 22 | $red = round($red * 2.55); 23 | $green = round($green * 2.55); 24 | $blue = round($blue * 2.55); 25 | 26 | // apply filter 27 | return imagefilter($image->getCore(), IMG_FILTER_COLORIZE, $red, $green, $blue); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/ContrastCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(-100, 100)->required()->value(); 18 | 19 | return imagefilter($image->getCore(), IMG_FILTER_CONTRAST, ($level * -1)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/CropCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 19 | $height = $this->argument(1)->type('digit')->required()->value(); 20 | $x = $this->argument(2)->type('digit')->value(); 21 | $y = $this->argument(3)->type('digit')->value(); 22 | 23 | if (is_null($width) || is_null($height)) { 24 | throw new \Intervention\Image\Exception\InvalidArgumentException( 25 | "Width and height of cutout needs to be defined." 26 | ); 27 | } 28 | 29 | $cropped = new Size($width, $height); 30 | $position = new Point($x, $y); 31 | 32 | // align boxes 33 | if (is_null($x) && is_null($y)) { 34 | $position = $image->getSize()->align('center')->relativePosition($cropped->align('center')); 35 | } 36 | 37 | // crop image core 38 | return $this->modify($image, 0, 0, $position->x, $position->y, $cropped->width, $cropped->height, $cropped->width, $cropped->height); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/DestroyCommand.php: -------------------------------------------------------------------------------- 1 | getCore()); 19 | 20 | // destroy backups 21 | foreach ($image->getBackups() as $backup) { 22 | imagedestroy($backup); 23 | } 24 | 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/FillCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 20 | $x = $this->argument(1)->type('digit')->value(); 21 | $y = $this->argument(2)->type('digit')->value(); 22 | 23 | $width = $image->getWidth(); 24 | $height = $image->getHeight(); 25 | $resource = $image->getCore(); 26 | 27 | try { 28 | 29 | // set image tile filling 30 | $source = new Decoder; 31 | $tile = $source->init($filling); 32 | imagesettile($image->getCore(), $tile->getCore()); 33 | $filling = IMG_COLOR_TILED; 34 | 35 | } catch (\Intervention\Image\Exception\NotReadableException $e) { 36 | 37 | // set solid color filling 38 | $color = new Color($filling); 39 | $filling = $color->getInt(); 40 | } 41 | 42 | imagealphablending($resource, true); 43 | 44 | if (is_int($x) && is_int($y)) { 45 | 46 | // resource should be visible through transparency 47 | $base = $image->getDriver()->newImage($width, $height)->getCore(); 48 | imagecopy($base, $resource, 0, 0, 0, 0, $width, $height); 49 | 50 | // floodfill if exact position is defined 51 | imagefill($resource, $x, $y, $filling); 52 | 53 | // copy filled original over base 54 | imagecopy($base, $resource, 0, 0, 0, 0, $width, $height); 55 | 56 | // set base as new resource-core 57 | $image->setCore($base); 58 | imagedestroy($resource); 59 | 60 | } else { 61 | // fill whole image otherwise 62 | imagefilledrectangle($resource, 0, 0, $width - 1, $height - 1, $filling); 63 | } 64 | 65 | isset($tile) ? imagedestroy($tile->getCore()) : null; 66 | 67 | return true; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/FitCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 18 | $height = $this->argument(1)->type('digit')->value($width); 19 | $constraints = $this->argument(2)->type('closure')->value(); 20 | $position = $this->argument(3)->type('string')->value('center'); 21 | 22 | // calculate size 23 | $cropped = $image->getSize()->fit(new Size($width, $height), $position); 24 | $resized = clone $cropped; 25 | $resized = $resized->resize($width, $height, $constraints); 26 | 27 | // modify image 28 | $this->modify($image, 0, 0, $cropped->pivot->x, $cropped->pivot->y, $resized->getWidth(), $resized->getHeight(), $cropped->getWidth(), $cropped->getHeight()); 29 | 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/FlipCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value('h'); 16 | 17 | $size = $image->getSize(); 18 | $dst = clone $size; 19 | 20 | switch (strtolower($mode)) { 21 | case 2: 22 | case 'v': 23 | case 'vert': 24 | case 'vertical': 25 | $size->pivot->y = $size->height - 1; 26 | $size->height = $size->height * (-1); 27 | break; 28 | 29 | default: 30 | $size->pivot->x = $size->width - 1; 31 | $size->width = $size->width * (-1); 32 | break; 33 | } 34 | 35 | return $this->modify($image, 0, 0, $size->pivot->x, $size->pivot->y, $dst->width, $dst->height, $size->width, $size->height); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/GammaCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 18 | 19 | return imagegammacorrect($image->getCore(), 1, $gamma); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/GetSizeCommand.php: -------------------------------------------------------------------------------- 1 | setOutput(new Size( 19 | imagesx($image->getCore()), 20 | imagesy($image->getCore()) 21 | )); 22 | 23 | return true; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/GreyscaleCommand.php: -------------------------------------------------------------------------------- 1 | getCore(), IMG_FILTER_GRAYSCALE); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/HeightenCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 16 | $additionalConstraints = $this->argument(1)->type('closure')->value(); 17 | 18 | $this->arguments[0] = null; 19 | $this->arguments[1] = $height; 20 | $this->arguments[2] = function ($constraint) use ($additionalConstraints) { 21 | $constraint->aspectRatio(); 22 | if(is_callable($additionalConstraints)) 23 | $additionalConstraints($constraint); 24 | }; 25 | 26 | return parent::execute($image); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/InsertCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->required()->value(); 18 | $position = $this->argument(1)->type('string')->value(); 19 | $x = $this->argument(2)->type('digit')->value(0); 20 | $y = $this->argument(3)->type('digit')->value(0); 21 | 22 | // build watermark 23 | $watermark = $image->getDriver()->init($source); 24 | 25 | // define insertion point 26 | $image_size = $image->getSize()->align($position, $x, $y); 27 | $watermark_size = $watermark->getSize()->align($position); 28 | $target = $image_size->relativePosition($watermark_size); 29 | 30 | // insert image at position 31 | imagealphablending($image->getCore(), true); 32 | return imagecopy($image->getCore(), $watermark->getCore(), $target->x, $target->y, 0, 0, $watermark_size->width, $watermark_size->height); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/InterlaceCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('bool')->value(true); 18 | 19 | imageinterlace($image->getCore(), $mode); 20 | 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/InvertCommand.php: -------------------------------------------------------------------------------- 1 | getCore(), IMG_FILTER_NEGATE); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/LimitColorsCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 19 | $matte = $this->argument(1)->value(); 20 | 21 | // get current image size 22 | $size = $image->getSize(); 23 | 24 | // create empty canvas 25 | $resource = imagecreatetruecolor($size->width, $size->height); 26 | 27 | // define matte 28 | if (is_null($matte)) { 29 | $matte = imagecolorallocatealpha($resource, 255, 255, 255, 127); 30 | } else { 31 | $matte = $image->getDriver()->parseColor($matte)->getInt(); 32 | } 33 | 34 | // fill with matte and copy original image 35 | imagefill($resource, 0, 0, $matte); 36 | 37 | // set transparency 38 | imagecolortransparent($resource, $matte); 39 | 40 | // copy original image 41 | imagecopy($resource, $image->getCore(), 0, 0, 0, 0, $size->width, $size->height); 42 | 43 | if (is_numeric($count) && $count <= 256) { 44 | // decrease colors 45 | imagetruecolortopalette($resource, true, $count); 46 | } 47 | 48 | // set new resource 49 | $image->setCore($resource); 50 | 51 | return true; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/MaskCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | $mask_w_alpha = $this->argument(1)->type('bool')->value(false); 19 | 20 | $image_size = $image->getSize(); 21 | 22 | // create empty canvas 23 | $canvas = $image->getDriver()->newImage($image_size->width, $image_size->height, [0,0,0,0]); 24 | 25 | // build mask image from source 26 | $mask = $image->getDriver()->init($mask_source); 27 | $mask_size = $mask->getSize(); 28 | 29 | // resize mask to size of current image (if necessary) 30 | if ($mask_size != $image_size) { 31 | $mask->resize($image_size->width, $image_size->height); 32 | } 33 | 34 | imagealphablending($canvas->getCore(), false); 35 | 36 | if ( ! $mask_w_alpha) { 37 | // mask from greyscale image 38 | imagefilter($mask->getCore(), IMG_FILTER_GRAYSCALE); 39 | } 40 | 41 | // redraw old image pixel by pixel considering alpha map 42 | for ($x=0; $x < $image_size->width; $x++) { 43 | for ($y=0; $y < $image_size->height; $y++) { 44 | 45 | $color = $image->pickColor($x, $y, 'array'); 46 | $alpha = $mask->pickColor($x, $y, 'array'); 47 | 48 | if ($mask_w_alpha) { 49 | $alpha = $alpha[3]; // use alpha channel as mask 50 | } else { 51 | 52 | if ($alpha[3] == 0) { // transparent as black 53 | $alpha = 0; 54 | } else { 55 | 56 | // $alpha = floatval(round((($alpha[0] + $alpha[1] + $alpha[3]) / 3) / 255, 2)); 57 | 58 | // image is greyscale, so channel doesn't matter (use red channel) 59 | $alpha = floatval(round($alpha[0] / 255, 2)); 60 | } 61 | 62 | } 63 | 64 | // preserve alpha of original image... 65 | if ($color[3] < $alpha) { 66 | $alpha = $color[3]; 67 | } 68 | 69 | // replace alpha value 70 | $color[3] = $alpha; 71 | 72 | // redraw pixel 73 | $canvas->pixel($color, $x, $y); 74 | } 75 | } 76 | 77 | 78 | // replace current image with masked instance 79 | $image->setCore($canvas->getCore()); 80 | 81 | return true; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/OpacityCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(0, 100)->required()->value(); 18 | 19 | // get size of image 20 | $size = $image->getSize(); 21 | 22 | // build temp alpha mask 23 | $mask_color = sprintf('rgba(0, 0, 0, %.1F)', $transparency / 100); 24 | $mask = $image->getDriver()->newImage($size->width, $size->height, $mask_color); 25 | 26 | // mask image 27 | $image->mask($mask->getCore(), true); 28 | 29 | return true; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/PickColorCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 19 | $y = $this->argument(1)->type('digit')->required()->value(); 20 | $format = $this->argument(2)->type('string')->value('array'); 21 | 22 | // pick color 23 | $color = imagecolorat($image->getCore(), $x, $y); 24 | 25 | if ( ! imageistruecolor($image->getCore())) { 26 | $color = imagecolorsforindex($image->getCore(), $color); 27 | $color['alpha'] = round(1 - $color['alpha'] / 127, 2); 28 | } 29 | 30 | $color = new Color($color); 31 | 32 | // format to output 33 | $this->setOutput($color->format($format)); 34 | 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->required()->value(); 19 | $color = new Color($color); 20 | $x = $this->argument(1)->type('digit')->required()->value(); 21 | $y = $this->argument(2)->type('digit')->required()->value(); 22 | 23 | return imagesetpixel($image->getCore(), $x, $y, $color->getInt()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelateCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->value(10); 18 | 19 | return imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $size, true); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResetCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 19 | 20 | if (is_resource($backup = $image->getBackup($backupName))) { 21 | 22 | // destroy current resource 23 | imagedestroy($image->getCore()); 24 | 25 | // clone backup 26 | $backup = $image->getDriver()->cloneCore($backup); 27 | 28 | // reset to new resource 29 | $image->setCore($backup); 30 | 31 | return true; 32 | } 33 | 34 | throw new RuntimeException( 35 | "Backup not available. Call backup() before reset()." 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCanvasCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 18 | $height = $this->argument(1)->type('digit')->required()->value(); 19 | $anchor = $this->argument(2)->value('center'); 20 | $relative = $this->argument(3)->type('boolean')->value(false); 21 | $bgcolor = $this->argument(4)->value(); 22 | 23 | $original_width = $image->getWidth(); 24 | $original_height = $image->getHeight(); 25 | 26 | // check of only width or height is set 27 | $width = is_null($width) ? $original_width : intval($width); 28 | $height = is_null($height) ? $original_height : intval($height); 29 | 30 | // check on relative width/height 31 | if ($relative) { 32 | $width = $original_width + $width; 33 | $height = $original_height + $height; 34 | } 35 | 36 | // check for negative width/height 37 | $width = ($width <= 0) ? $width + $original_width : $width; 38 | $height = ($height <= 0) ? $height + $original_height : $height; 39 | 40 | // create new canvas 41 | $canvas = $image->getDriver()->newImage($width, $height, $bgcolor); 42 | 43 | // set copy position 44 | $canvas_size = $canvas->getSize()->align($anchor); 45 | $image_size = $image->getSize()->align($anchor); 46 | $canvas_pos = $image_size->relativePosition($canvas_size); 47 | $image_pos = $canvas_size->relativePosition($image_size); 48 | 49 | if ($width <= $original_width) { 50 | $dst_x = 0; 51 | $src_x = $canvas_pos->x; 52 | $src_w = $canvas_size->width; 53 | } else { 54 | $dst_x = $image_pos->x; 55 | $src_x = 0; 56 | $src_w = $original_width; 57 | } 58 | 59 | if ($height <= $original_height) { 60 | $dst_y = 0; 61 | $src_y = $canvas_pos->y; 62 | $src_h = $canvas_size->height; 63 | } else { 64 | $dst_y = $image_pos->y; 65 | $src_y = 0; 66 | $src_h = $original_height; 67 | } 68 | 69 | // make image area transparent to keep transparency 70 | // even if background-color is set 71 | $transparent = imagecolorallocatealpha($canvas->getCore(), 255, 255, 255, 127); 72 | imagealphablending($canvas->getCore(), false); // do not blend / just overwrite 73 | imagefilledrectangle($canvas->getCore(), $dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1, $transparent); 74 | 75 | // copy image into new canvas 76 | imagecopy($canvas->getCore(), $image->getCore(), $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); 77 | 78 | // set new core to canvas 79 | $image->setCore($canvas->getCore()); 80 | 81 | return true; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | $height = $this->argument(1)->value(); 19 | $constraints = $this->argument(2)->type('closure')->value(); 20 | 21 | // resize box 22 | $resized = $image->getSize()->resize($width, $height, $constraints); 23 | 24 | // modify image 25 | $this->modify($image, 0, 0, 0, 0, $resized->getWidth(), $resized->getHeight(), $image->getWidth(), $image->getHeight()); 26 | 27 | return true; 28 | } 29 | 30 | /** 31 | * Wrapper function for 'imagecopyresampled' 32 | * 33 | * @param Image $image 34 | * @param int $dst_x 35 | * @param int $dst_y 36 | * @param int $src_x 37 | * @param int $src_y 38 | * @param int $dst_w 39 | * @param int $dst_h 40 | * @param int $src_w 41 | * @param int $src_h 42 | * @return boolean 43 | */ 44 | protected function modify($image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) 45 | { 46 | // create new image 47 | $modified = imagecreatetruecolor($dst_w, $dst_h); 48 | 49 | // get current image 50 | $resource = $image->getCore(); 51 | 52 | // preserve transparency 53 | $transIndex = imagecolortransparent($resource); 54 | 55 | if ($transIndex != -1) { 56 | $rgba = imagecolorsforindex($modified, $transIndex); 57 | $transColor = imagecolorallocatealpha($modified, $rgba['red'], $rgba['green'], $rgba['blue'], 127); 58 | imagefill($modified, 0, 0, $transColor); 59 | imagecolortransparent($modified, $transColor); 60 | } else { 61 | imagealphablending($modified, false); 62 | imagesavealpha($modified, true); 63 | } 64 | 65 | // copy content from resource 66 | $result = imagecopyresampled( 67 | $modified, 68 | $resource, 69 | $dst_x, 70 | $dst_y, 71 | $src_x, 72 | $src_y, 73 | $dst_w, 74 | $dst_h, 75 | $src_w, 76 | $src_h 77 | ); 78 | 79 | // set new content as recource 80 | $image->setCore($modified); 81 | 82 | return $result; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/RotateCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 19 | $color = $this->argument(1)->value(); 20 | $color = new Color($color); 21 | 22 | // restrict rotations beyond 360 degrees, since the end result is the same 23 | $angle %= 360; 24 | 25 | // rotate image 26 | $image->setCore(imagerotate($image->getCore(), $angle, $color->getInt())); 27 | 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/SharpenCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(0, 100)->value(10); 18 | 19 | // build matrix 20 | $min = $amount >= 10 ? $amount * -0.01 : 0; 21 | $max = $amount * -0.025; 22 | $abs = ((4 * $min + 4 * $max) * -1) + 1; 23 | $div = 1; 24 | 25 | $matrix = [ 26 | [$min, $max, $min], 27 | [$max, $abs, $max], 28 | [$min, $max, $min] 29 | ]; 30 | 31 | // apply the matrix 32 | return imageconvolution($image->getCore(), $matrix, $div, 0); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Commands/WidenCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 16 | $additionalConstraints = $this->argument(1)->type('closure')->value(); 17 | 18 | $this->arguments[0] = $width; 19 | $this->arguments[1] = null; 20 | $this->arguments[2] = function ($constraint) use ($additionalConstraints) { 21 | $constraint->aspectRatio(); 22 | if(is_callable($additionalConstraints)) 23 | $additionalConstraints($constraint); 24 | }; 25 | 26 | return parent::execute($image); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Driver.php: -------------------------------------------------------------------------------- 1 | coreAvailable()) { 19 | throw new NotSupportedException( 20 | "GD Library extension not available with this PHP installation." 21 | ); 22 | } 23 | 24 | $this->decoder = $decoder ? $decoder : new Decoder; 25 | $this->encoder = $encoder ? $encoder : new Encoder; 26 | } 27 | 28 | /** 29 | * Creates new image instance 30 | * 31 | * @param int $width 32 | * @param int $height 33 | * @param mixed $background 34 | * @return \Intervention\Image\Image 35 | */ 36 | public function newImage($width, $height, $background = null) 37 | { 38 | // create empty resource 39 | $core = imagecreatetruecolor($width, $height); 40 | $image = new Image(new static, $core); 41 | 42 | // set background color 43 | $background = new Color($background); 44 | imagefill($image->getCore(), 0, 0, $background->getInt()); 45 | 46 | return $image; 47 | } 48 | 49 | /** 50 | * Reads given string into color object 51 | * 52 | * @param string $value 53 | * @return AbstractColor 54 | */ 55 | public function parseColor($value) 56 | { 57 | return new Color($value); 58 | } 59 | 60 | /** 61 | * Checks if core module installation is available 62 | * 63 | * @return boolean 64 | */ 65 | protected function coreAvailable() 66 | { 67 | return (extension_loaded('gd') && function_exists('gd_info')); 68 | } 69 | 70 | /** 71 | * Returns clone of given core 72 | * 73 | * @return mixed 74 | */ 75 | public function cloneCore($core) 76 | { 77 | $width = imagesx($core); 78 | $height = imagesy($core); 79 | $clone = imagecreatetruecolor($width, $height); 80 | imagealphablending($clone, false); 81 | imagesavealpha($clone, true); 82 | $transparency = imagecolorallocatealpha($clone, 0, 0, 0, 127); 83 | imagefill($clone, 0, 0, $transparency); 84 | 85 | imagecopy($clone, $core, 0, 0, 0, 0, $width, $height); 86 | 87 | return $clone; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Encoder.php: -------------------------------------------------------------------------------- 1 | image->getCore(), null, $this->quality); 18 | $this->image->mime = image_type_to_mime_type(IMAGETYPE_JPEG); 19 | $buffer = ob_get_contents(); 20 | ob_end_clean(); 21 | 22 | return $buffer; 23 | } 24 | 25 | /** 26 | * Processes and returns encoded image as PNG string 27 | * 28 | * @return string 29 | */ 30 | protected function processPng() 31 | { 32 | ob_start(); 33 | $resource = $this->image->getCore(); 34 | imagealphablending($resource, false); 35 | imagesavealpha($resource, true); 36 | imagepng($resource, null, -1); 37 | $this->image->mime = image_type_to_mime_type(IMAGETYPE_PNG); 38 | $buffer = ob_get_contents(); 39 | ob_end_clean(); 40 | 41 | return $buffer; 42 | } 43 | 44 | /** 45 | * Processes and returns encoded image as GIF string 46 | * 47 | * @return string 48 | */ 49 | protected function processGif() 50 | { 51 | ob_start(); 52 | imagegif($this->image->getCore()); 53 | $this->image->mime = image_type_to_mime_type(IMAGETYPE_GIF); 54 | $buffer = ob_get_contents(); 55 | ob_end_clean(); 56 | 57 | return $buffer; 58 | } 59 | 60 | protected function processWebp() 61 | { 62 | if ( ! function_exists('imagewebp')) { 63 | throw new NotSupportedException( 64 | "Webp format is not supported by PHP installation." 65 | ); 66 | } 67 | 68 | ob_start(); 69 | imagewebp($this->image->getCore(), null, $this->quality); 70 | $this->image->mime = defined('IMAGETYPE_WEBP') ? image_type_to_mime_type(IMAGETYPE_WEBP) : 'image/webp'; 71 | $buffer = ob_get_contents(); 72 | ob_end_clean(); 73 | 74 | return $buffer; 75 | } 76 | 77 | /** 78 | * Processes and returns encoded image as TIFF string 79 | * 80 | * @return string 81 | */ 82 | protected function processTiff() 83 | { 84 | throw new NotSupportedException( 85 | "TIFF format is not supported by Gd Driver." 86 | ); 87 | } 88 | 89 | /** 90 | * Processes and returns encoded image as BMP string 91 | * 92 | * @return string 93 | */ 94 | protected function processBmp() 95 | { 96 | throw new NotSupportedException( 97 | "BMP format is not supported by Gd Driver." 98 | ); 99 | } 100 | 101 | /** 102 | * Processes and returns encoded image as ICO string 103 | * 104 | * @return string 105 | */ 106 | protected function processIco() 107 | { 108 | throw new NotSupportedException( 109 | "ICO format is not supported by Gd Driver." 110 | ); 111 | } 112 | 113 | /** 114 | * Processes and returns encoded image as PSD string 115 | * 116 | * @return string 117 | */ 118 | protected function processPsd() 119 | { 120 | throw new NotSupportedException( 121 | "PSD format is not supported by Gd Driver." 122 | ); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Shapes/CircleShape.php: -------------------------------------------------------------------------------- 1 | width = is_numeric($diameter) ? intval($diameter) : $this->diameter; 24 | $this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter; 25 | $this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter; 26 | } 27 | 28 | /** 29 | * Draw current circle on given image 30 | * 31 | * @param Image $image 32 | * @param int $x 33 | * @param int $y 34 | * @return boolean 35 | */ 36 | public function applyToImage(Image $image, $x = 0, $y = 0) 37 | { 38 | return parent::applyToImage($image, $x, $y); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Shapes/EllipseShape.php: -------------------------------------------------------------------------------- 1 | width = is_numeric($width) ? intval($width) : $this->width; 34 | $this->height = is_numeric($height) ? intval($height) : $this->height; 35 | } 36 | 37 | /** 38 | * Draw ellipse instance on given image 39 | * 40 | * @param Image $image 41 | * @param int $x 42 | * @param int $y 43 | * @return boolean 44 | */ 45 | public function applyToImage(Image $image, $x = 0, $y = 0) 46 | { 47 | // parse background color 48 | $background = new Color($this->background); 49 | 50 | if ($this->hasBorder()) { 51 | // slightly smaller ellipse to keep 1px bordered edges clean 52 | imagefilledellipse($image->getCore(), $x, $y, $this->width-1, $this->height-1, $background->getInt()); 53 | 54 | $border_color = new Color($this->border_color); 55 | imagesetthickness($image->getCore(), $this->border_width); 56 | 57 | // gd's imageellipse doesn't respect imagesetthickness so i use imagearc with 359.9 degrees here 58 | imagearc($image->getCore(), $x, $y, $this->width, $this->height, 0, 359.99, $border_color->getInt()); 59 | } else { 60 | imagefilledellipse($image->getCore(), $x, $y, $this->width, $this->height, $background->getInt()); 61 | } 62 | 63 | return true; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Shapes/LineShape.php: -------------------------------------------------------------------------------- 1 | x = is_numeric($x) ? intval($x) : $this->x; 48 | $this->y = is_numeric($y) ? intval($y) : $this->y; 49 | } 50 | 51 | /** 52 | * Set current line color 53 | * 54 | * @param string $color 55 | * @return void 56 | */ 57 | public function color($color) 58 | { 59 | $this->color = $color; 60 | } 61 | 62 | /** 63 | * Set current line width in pixels 64 | * 65 | * @param int $width 66 | * @return void 67 | */ 68 | public function width($width) 69 | { 70 | throw new \Intervention\Image\Exception\NotSupportedException( 71 | "Line width is not supported by GD driver." 72 | ); 73 | } 74 | 75 | /** 76 | * Draw current instance of line to given endpoint on given image 77 | * 78 | * @param Image $image 79 | * @param int $x 80 | * @param int $y 81 | * @return boolean 82 | */ 83 | public function applyToImage(Image $image, $x = 0, $y = 0) 84 | { 85 | $color = new Color($this->color); 86 | imageline($image->getCore(), $x, $y, $this->x, $this->y, $color->getInt()); 87 | 88 | return true; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Shapes/PolygonShape.php: -------------------------------------------------------------------------------- 1 | points = $points; 26 | } 27 | 28 | /** 29 | * Draw polygon on given image 30 | * 31 | * @param Image $image 32 | * @param int $x 33 | * @param int $y 34 | * @return boolean 35 | */ 36 | public function applyToImage(Image $image, $x = 0, $y = 0) 37 | { 38 | $background = new Color($this->background); 39 | imagefilledpolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $background->getInt()); 40 | 41 | if ($this->hasBorder()) { 42 | $border_color = new Color($this->border_color); 43 | imagesetthickness($image->getCore(), $this->border_width); 44 | imagepolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $border_color->getInt()); 45 | } 46 | 47 | return true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Gd/Shapes/RectangleShape.php: -------------------------------------------------------------------------------- 1 | x1 = is_numeric($x1) ? intval($x1) : $this->x1; 50 | $this->y1 = is_numeric($y1) ? intval($y1) : $this->y1; 51 | $this->x2 = is_numeric($x2) ? intval($x2) : $this->x2; 52 | $this->y2 = is_numeric($y2) ? intval($y2) : $this->y2; 53 | } 54 | 55 | /** 56 | * Draw rectangle to given image at certain position 57 | * 58 | * @param Image $image 59 | * @param int $x 60 | * @param int $y 61 | * @return boolean 62 | */ 63 | public function applyToImage(Image $image, $x = 0, $y = 0) 64 | { 65 | $background = new Color($this->background); 66 | imagefilledrectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $background->getInt()); 67 | 68 | if ($this->hasBorder()) { 69 | $border_color = new Color($this->border_color); 70 | imagesetthickness($image->getCore(), $this->border_width); 71 | imagerectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $border_color->getInt()); 72 | } 73 | 74 | return true; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/ImageManagerStatic.php: -------------------------------------------------------------------------------- 1 | configure($config); 46 | } 47 | 48 | /** 49 | * Statically initiates an Image instance from different input types 50 | * 51 | * @param mixed $data 52 | * 53 | * @return \Intervention\Image\Image 54 | * @throws \Intervention\Image\Exception\NotReadableException 55 | */ 56 | public static function make($data) 57 | { 58 | return self::getManager()->make($data); 59 | } 60 | 61 | /** 62 | * Statically creates an empty image canvas 63 | * 64 | * @param int $width 65 | * @param int $height 66 | * @param mixed $background 67 | * 68 | * @return \Intervention\Image\Image 69 | */ 70 | public static function canvas($width, $height, $background = null) 71 | { 72 | return self::getManager()->canvas($width, $height, $background); 73 | } 74 | 75 | /** 76 | * Create new cached image and run callback statically 77 | * 78 | * @param Closure $callback 79 | * @param int $lifetime 80 | * @param boolean $returnObj 81 | * 82 | * @return mixed 83 | */ 84 | public static function cache(Closure $callback, $lifetime = null, $returnObj = false) 85 | { 86 | return self::getManager()->cache($callback, $lifetime, $returnObj); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/ImageServiceProvider.php: -------------------------------------------------------------------------------- 1 | provider = $this->getProvider(); 36 | } 37 | 38 | /** 39 | * Bootstrap the application events. 40 | * 41 | * @return void 42 | */ 43 | public function boot() 44 | { 45 | if (method_exists($this->provider, 'boot')) { 46 | return $this->provider->boot(); 47 | } 48 | } 49 | 50 | /** 51 | * Register the service provider. 52 | * 53 | * @return void 54 | */ 55 | public function register() 56 | { 57 | return $this->provider->register(); 58 | } 59 | 60 | /** 61 | * Return ServiceProvider according to Laravel version 62 | * 63 | * @return \Intervention\Image\Provider\ProviderInterface 64 | */ 65 | private function getProvider() 66 | { 67 | if ($this->app instanceof LumenApplication) { 68 | $provider = '\Intervention\Image\ImageServiceProviderLumen'; 69 | } elseif (version_compare(IlluminateApplication::VERSION, '5.0', '<')) { 70 | $provider = '\Intervention\Image\ImageServiceProviderLaravel4'; 71 | } else { 72 | $provider = '\Intervention\Image\ImageServiceProviderLaravelRecent'; 73 | } 74 | 75 | return new $provider($this->app); 76 | } 77 | 78 | /** 79 | * Get the services provided by the provider. 80 | * 81 | * @return array 82 | */ 83 | public function provides() 84 | { 85 | return ['image']; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLeague.php: -------------------------------------------------------------------------------- 1 | config = $config; 29 | } 30 | 31 | /** 32 | * Register the server provider. 33 | * 34 | * @return void 35 | */ 36 | public function register() 37 | { 38 | $this->getContainer()->share('Intervention\Image\ImageManager', function () { 39 | return new ImageManager($this->config); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLumen.php: -------------------------------------------------------------------------------- 1 | app; 17 | 18 | // merge default config 19 | $this->mergeConfigFrom( 20 | __DIR__.'/../../config/config.php', 21 | 'image' 22 | ); 23 | 24 | // set configuration 25 | $app->configure('image'); 26 | 27 | // create image 28 | $app->singleton('image',function ($app) { 29 | return new ImageManager($app['config']->get('image')); 30 | }); 31 | 32 | $app->alias('image', 'Intervention\Image\ImageManager'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BackupCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | 19 | // clone current image resource 20 | $clone = clone $image; 21 | $image->setBackup($clone->getCore(), $backupName); 22 | 23 | return true; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BlurCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(0, 100)->value(1); 18 | 19 | return $image->getCore()->blurImage(1 * $amount, 0.5 * $amount); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BrightnessCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(-100, 100)->required()->value(); 18 | 19 | return $image->getCore()->modulateImage(100 + $level, 100, 100); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ColorizeCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(-100, 100)->required()->value(); 18 | $green = $this->argument(1)->between(-100, 100)->required()->value(); 19 | $blue = $this->argument(2)->between(-100, 100)->required()->value(); 20 | 21 | // normalize colorize levels 22 | $red = $this->normalizeLevel($red); 23 | $green = $this->normalizeLevel($green); 24 | $blue = $this->normalizeLevel($blue); 25 | 26 | $qrange = $image->getCore()->getQuantumRange(); 27 | 28 | // apply 29 | $image->getCore()->levelImage(0, $red, $qrange['quantumRangeLong'], \Imagick::CHANNEL_RED); 30 | $image->getCore()->levelImage(0, $green, $qrange['quantumRangeLong'], \Imagick::CHANNEL_GREEN); 31 | $image->getCore()->levelImage(0, $blue, $qrange['quantumRangeLong'], \Imagick::CHANNEL_BLUE); 32 | 33 | return true; 34 | } 35 | 36 | private function normalizeLevel($level) 37 | { 38 | if ($level > 0) { 39 | return $level/5; 40 | } else { 41 | return ($level+100)/100; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ContrastCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(-100, 100)->required()->value(); 18 | 19 | return $image->getCore()->sigmoidalContrastImage($level > 0, $level / 4, 0); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/CropCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 21 | $height = $this->argument(1)->type('digit')->required()->value(); 22 | $x = $this->argument(2)->type('digit')->value(); 23 | $y = $this->argument(3)->type('digit')->value(); 24 | 25 | if (is_null($width) || is_null($height)) { 26 | throw new InvalidArgumentException( 27 | "Width and height of cutout needs to be defined." 28 | ); 29 | } 30 | 31 | $cropped = new Size($width, $height); 32 | $position = new Point($x, $y); 33 | 34 | // align boxes 35 | if (is_null($x) && is_null($y)) { 36 | $position = $image->getSize()->align('center')->relativePosition($cropped->align('center')); 37 | } 38 | 39 | // crop image core 40 | $image->getCore()->cropImage($cropped->width, $cropped->height, $position->x, $position->y); 41 | $image->getCore()->setImagePage(0,0,0,0); 42 | 43 | return true; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/DestroyCommand.php: -------------------------------------------------------------------------------- 1 | getCore()->clear(); 19 | 20 | // destroy backups 21 | foreach ($image->getBackups() as $backup) { 22 | $backup->clear(); 23 | } 24 | 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FitCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 19 | $height = $this->argument(1)->type('digit')->value($width); 20 | $constraints = $this->argument(2)->type('closure')->value(); 21 | $position = $this->argument(3)->type('string')->value('center'); 22 | 23 | // calculate size 24 | $cropped = $image->getSize()->fit(new Size($width, $height), $position); 25 | $resized = clone $cropped; 26 | $resized = $resized->resize($width, $height, $constraints); 27 | 28 | // crop image 29 | $image->getCore()->cropImage( 30 | $cropped->width, 31 | $cropped->height, 32 | $cropped->pivot->x, 33 | $cropped->pivot->y 34 | ); 35 | 36 | // resize image 37 | $image->getCore()->scaleImage($resized->getWidth(), $resized->getHeight()); 38 | $image->getCore()->setImagePage(0,0,0,0); 39 | 40 | return true; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FlipCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value('h'); 18 | 19 | if (in_array(strtolower($mode), [2, 'v', 'vert', 'vertical'])) { 20 | // flip vertical 21 | return $image->getCore()->flipImage(); 22 | } else { 23 | // flip horizontal 24 | return $image->getCore()->flopImage(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GammaCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 18 | 19 | return $image->getCore()->gammaImage($gamma); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php: -------------------------------------------------------------------------------- 1 | getCore(); 20 | 21 | $this->setOutput(new Size( 22 | $core->getImageWidth(), 23 | $core->getImageHeight() 24 | )); 25 | 26 | return true; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GreyscaleCommand.php: -------------------------------------------------------------------------------- 1 | getCore()->modulateImage(100, 0, 100); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/HeightenCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 16 | $additionalConstraints = $this->argument(1)->type('closure')->value(); 17 | 18 | $this->arguments[0] = null; 19 | $this->arguments[1] = $height; 20 | $this->arguments[2] = function ($constraint) use ($additionalConstraints) { 21 | $constraint->aspectRatio(); 22 | if(is_callable($additionalConstraints)) 23 | $additionalConstraints($constraint); 24 | }; 25 | 26 | return parent::execute($image); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InsertCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->required()->value(); 18 | $position = $this->argument(1)->type('string')->value(); 19 | $x = $this->argument(2)->type('digit')->value(0); 20 | $y = $this->argument(3)->type('digit')->value(0); 21 | 22 | // build watermark 23 | $watermark = $image->getDriver()->init($source); 24 | 25 | // define insertion point 26 | $image_size = $image->getSize()->align($position, $x, $y); 27 | $watermark_size = $watermark->getSize()->align($position); 28 | $target = $image_size->relativePosition($watermark_size); 29 | 30 | // insert image at position 31 | return $image->getCore()->compositeImage($watermark->getCore(), \Imagick::COMPOSITE_DEFAULT, $target->x, $target->y); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InterlaceCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('bool')->value(true); 18 | 19 | if ($mode) { 20 | $mode = \Imagick::INTERLACE_LINE; 21 | } else { 22 | $mode = \Imagick::INTERLACE_NO; 23 | } 24 | 25 | $image->getCore()->setInterlaceScheme($mode); 26 | 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InvertCommand.php: -------------------------------------------------------------------------------- 1 | getCore()->negateImage(false); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/LimitColorsCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | $matte = $this->argument(1)->value(); 19 | 20 | // get current image size 21 | $size = $image->getSize(); 22 | 23 | // build 2 color alpha mask from original alpha 24 | $alpha = clone $image->getCore(); 25 | $alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA); 26 | $alpha->transparentPaintImage('#ffffff', 0, 0, false); 27 | $alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA); 28 | $alpha->negateImage(false); 29 | 30 | if ($matte) { 31 | 32 | // get matte color 33 | $mattecolor = $image->getDriver()->parseColor($matte)->getPixel(); 34 | 35 | // create matte image 36 | $canvas = new \Imagick; 37 | $canvas->newImage($size->width, $size->height, $mattecolor, 'png'); 38 | 39 | // lower colors of original and copy to matte 40 | $image->getCore()->quantizeImage($count, \Imagick::COLORSPACE_RGB, 0, false, false); 41 | $canvas->compositeImage($image->getCore(), \Imagick::COMPOSITE_DEFAULT, 0, 0); 42 | 43 | // copy new alpha to canvas 44 | $canvas->compositeImage($alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); 45 | 46 | // replace core 47 | $image->setCore($canvas); 48 | 49 | } else { 50 | 51 | $image->getCore()->quantizeImage($count, \Imagick::COLORSPACE_RGB, 0, false, false); 52 | $image->getCore()->compositeImage($alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); 53 | 54 | } 55 | 56 | return true; 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/MaskCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | $mask_w_alpha = $this->argument(1)->type('bool')->value(false); 19 | 20 | // get imagick 21 | $imagick = $image->getCore(); 22 | 23 | // build mask image from source 24 | $mask = $image->getDriver()->init($mask_source); 25 | 26 | // resize mask to size of current image (if necessary) 27 | $image_size = $image->getSize(); 28 | if ($mask->getSize() != $image_size) { 29 | $mask->resize($image_size->width, $image_size->height); 30 | } 31 | 32 | $imagick->setImageMatte(true); 33 | 34 | if ($mask_w_alpha) { 35 | 36 | // just mask with alpha map 37 | $imagick->compositeImage($mask->getCore(), \Imagick::COMPOSITE_DSTIN, 0, 0); 38 | 39 | } else { 40 | 41 | // get alpha channel of original as greyscale image 42 | $original_alpha = clone $imagick; 43 | $original_alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA); 44 | 45 | // use red channel from mask ask alpha 46 | $mask_alpha = clone $mask->getCore(); 47 | $mask_alpha->compositeImage($mask->getCore(), \Imagick::COMPOSITE_DEFAULT, 0, 0); 48 | // $mask_alpha->setImageAlphaChannel(\Imagick::ALPHACHANNEL_DEACTIVATE); 49 | $mask_alpha->separateImageChannel(\Imagick::CHANNEL_ALL); 50 | 51 | // combine both alphas from original and mask 52 | $original_alpha->compositeImage($mask_alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); 53 | 54 | // mask the image with the alpha combination 55 | $imagick->compositeImage($original_alpha, \Imagick::COMPOSITE_DSTIN, 0, 0); 56 | } 57 | 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/OpacityCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(0, 100)->required()->value(); 18 | 19 | $transparency = $transparency > 0 ? (100 / $transparency) : 1000; 20 | 21 | return $image->getCore()->evaluateImage(\Imagick::EVALUATE_DIVIDE, $transparency, \Imagick::CHANNEL_ALPHA); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PickColorCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 19 | $y = $this->argument(1)->type('digit')->required()->value(); 20 | $format = $this->argument(2)->type('string')->value('array'); 21 | 22 | // pick color 23 | $color = new Color($image->getCore()->getImagePixelColor($x, $y)); 24 | 25 | // format to output 26 | $this->setOutput($color->format($format)); 27 | 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->required()->value(); 19 | $color = new Color($color); 20 | $x = $this->argument(1)->type('digit')->required()->value(); 21 | $y = $this->argument(2)->type('digit')->required()->value(); 22 | 23 | // prepare pixel 24 | $draw = new \ImagickDraw; 25 | $draw->setFillColor($color->getPixel()); 26 | $draw->point($x, $y); 27 | 28 | // apply pixel 29 | return $image->getCore()->drawImage($draw); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelateCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->value(10); 18 | 19 | $width = $image->getWidth(); 20 | $height = $image->getHeight(); 21 | 22 | $image->getCore()->scaleImage(max(1, ($width / $size)), max(1, ($height / $size))); 23 | $image->getCore()->scaleImage($width, $height); 24 | 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResetCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 19 | 20 | $backup = $image->getBackup($backupName); 21 | 22 | if ($backup instanceof \Imagick) { 23 | 24 | // destroy current core 25 | $image->getCore()->clear(); 26 | 27 | // clone backup 28 | $backup = clone $backup; 29 | 30 | // reset to new resource 31 | $image->setCore($backup); 32 | 33 | return true; 34 | } 35 | 36 | throw new RuntimeException( 37 | "Backup not available. Call backup({$backupName}) before reset()." 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCanvasCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 18 | $height = $this->argument(1)->type('digit')->required()->value(); 19 | $anchor = $this->argument(2)->value('center'); 20 | $relative = $this->argument(3)->type('boolean')->value(false); 21 | $bgcolor = $this->argument(4)->value(); 22 | 23 | $original_width = $image->getWidth(); 24 | $original_height = $image->getHeight(); 25 | 26 | // check of only width or height is set 27 | $width = is_null($width) ? $original_width : intval($width); 28 | $height = is_null($height) ? $original_height : intval($height); 29 | 30 | // check on relative width/height 31 | if ($relative) { 32 | $width = $original_width + $width; 33 | $height = $original_height + $height; 34 | } 35 | 36 | // check for negative width/height 37 | $width = ($width <= 0) ? $width + $original_width : $width; 38 | $height = ($height <= 0) ? $height + $original_height : $height; 39 | 40 | // create new canvas 41 | $canvas = $image->getDriver()->newImage($width, $height, $bgcolor); 42 | 43 | // set copy position 44 | $canvas_size = $canvas->getSize()->align($anchor); 45 | $image_size = $image->getSize()->align($anchor); 46 | $canvas_pos = $image_size->relativePosition($canvas_size); 47 | $image_pos = $canvas_size->relativePosition($image_size); 48 | 49 | if ($width <= $original_width) { 50 | $dst_x = 0; 51 | $src_x = $canvas_pos->x; 52 | $src_w = $canvas_size->width; 53 | } else { 54 | $dst_x = $image_pos->x; 55 | $src_x = 0; 56 | $src_w = $original_width; 57 | } 58 | 59 | if ($height <= $original_height) { 60 | $dst_y = 0; 61 | $src_y = $canvas_pos->y; 62 | $src_h = $canvas_size->height; 63 | } else { 64 | $dst_y = $image_pos->y; 65 | $src_y = 0; 66 | $src_h = $original_height; 67 | } 68 | 69 | // make image area transparent to keep transparency 70 | // even if background-color is set 71 | $rect = new \ImagickDraw; 72 | $fill = $canvas->pickColor(0, 0, 'hex'); 73 | $fill = $fill == '#ff0000' ? '#00ff00' : '#ff0000'; 74 | $rect->setFillColor($fill); 75 | $rect->rectangle($dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1); 76 | $canvas->getCore()->drawImage($rect); 77 | $canvas->getCore()->transparentPaintImage($fill, 0, 0, false); 78 | 79 | $canvas->getCore()->setImageColorspace($image->getCore()->getImageColorspace()); 80 | 81 | // copy image into new canvas 82 | $image->getCore()->cropImage($src_w, $src_h, $src_x, $src_y); 83 | $canvas->getCore()->compositeImage($image->getCore(), \Imagick::COMPOSITE_DEFAULT, $dst_x, $dst_y); 84 | $canvas->getCore()->setImagePage(0,0,0,0); 85 | 86 | // set new core to canvas 87 | $image->setCore($canvas->getCore()); 88 | 89 | return true; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->value(); 18 | $height = $this->argument(1)->value(); 19 | $constraints = $this->argument(2)->type('closure')->value(); 20 | 21 | // resize box 22 | $resized = $image->getSize()->resize($width, $height, $constraints); 23 | 24 | // modify image 25 | $image->getCore()->scaleImage($resized->getWidth(), $resized->getHeight()); 26 | 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/RotateCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('numeric')->required()->value(); 19 | $color = $this->argument(1)->value(); 20 | $color = new Color($color); 21 | 22 | // restrict rotations beyond 360 degrees, since the end result is the same 23 | $angle %= 360; 24 | 25 | // rotate image 26 | $image->getCore()->rotateImage($color->getPixel(), ($angle * -1)); 27 | 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/SharpenCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->between(0, 100)->value(10); 18 | 19 | return $image->getCore()->unsharpMaskImage(1, 1, $amount / 6.25, 0); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Commands/WidenCommand.php: -------------------------------------------------------------------------------- 1 | argument(0)->type('digit')->required()->value(); 16 | $additionalConstraints = $this->argument(1)->type('closure')->value(); 17 | 18 | $this->arguments[0] = $width; 19 | $this->arguments[1] = null; 20 | $this->arguments[2] = function ($constraint) use ($additionalConstraints) { 21 | $constraint->aspectRatio(); 22 | if(is_callable($additionalConstraints)) 23 | $additionalConstraints($constraint); 24 | }; 25 | 26 | return parent::execute($image); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Driver.php: -------------------------------------------------------------------------------- 1 | coreAvailable()) { 20 | throw new NotSupportedException( 21 | "ImageMagick module not available with this PHP installation." 22 | ); 23 | } 24 | 25 | $this->decoder = $decoder ? $decoder : new Decoder; 26 | $this->encoder = $encoder ? $encoder : new Encoder; 27 | } 28 | 29 | /** 30 | * Creates new image instance 31 | * 32 | * @param int $width 33 | * @param int $height 34 | * @param mixed $background 35 | * @return \Intervention\Image\Image 36 | */ 37 | public function newImage($width, $height, $background = null) 38 | { 39 | $background = new Color($background); 40 | 41 | // create empty core 42 | $core = new \Imagick; 43 | $core->newImage($width, $height, $background->getPixel(), 'png'); 44 | $core->setType(\Imagick::IMGTYPE_UNDEFINED); 45 | $core->setImageType(\Imagick::IMGTYPE_UNDEFINED); 46 | $core->setColorspace(\Imagick::COLORSPACE_UNDEFINED); 47 | 48 | // build image 49 | $image = new Image(new static, $core); 50 | 51 | return $image; 52 | } 53 | 54 | /** 55 | * Reads given string into color object 56 | * 57 | * @param string $value 58 | * @return AbstractColor 59 | */ 60 | public function parseColor($value) 61 | { 62 | return new Color($value); 63 | } 64 | 65 | /** 66 | * Checks if core module installation is available 67 | * 68 | * @return boolean 69 | */ 70 | protected function coreAvailable() 71 | { 72 | return (extension_loaded('imagick') && class_exists('Imagick')); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/CircleShape.php: -------------------------------------------------------------------------------- 1 | width = is_numeric($diameter) ? intval($diameter) : $this->diameter; 24 | $this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter; 25 | $this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter; 26 | } 27 | 28 | /** 29 | * Draw current circle on given image 30 | * 31 | * @param Image $image 32 | * @param int $x 33 | * @param int $y 34 | * @return boolean 35 | */ 36 | public function applyToImage(Image $image, $x = 0, $y = 0) 37 | { 38 | return parent::applyToImage($image, $x, $y); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/EllipseShape.php: -------------------------------------------------------------------------------- 1 | width = is_numeric($width) ? intval($width) : $this->width; 34 | $this->height = is_numeric($height) ? intval($height) : $this->height; 35 | } 36 | 37 | /** 38 | * Draw ellipse instance on given image 39 | * 40 | * @param Image $image 41 | * @param int $x 42 | * @param int $y 43 | * @return boolean 44 | */ 45 | public function applyToImage(Image $image, $x = 0, $y = 0) 46 | { 47 | $circle = new \ImagickDraw; 48 | 49 | // set background 50 | $bgcolor = new Color($this->background); 51 | $circle->setFillColor($bgcolor->getPixel()); 52 | 53 | // set border 54 | if ($this->hasBorder()) { 55 | $border_color = new Color($this->border_color); 56 | $circle->setStrokeWidth($this->border_width); 57 | $circle->setStrokeColor($border_color->getPixel()); 58 | } 59 | 60 | $circle->ellipse($x, $y, $this->width / 2, $this->height / 2, 0, 360); 61 | 62 | $image->getCore()->drawImage($circle); 63 | 64 | return true; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/LineShape.php: -------------------------------------------------------------------------------- 1 | x = is_numeric($x) ? intval($x) : $this->x; 48 | $this->y = is_numeric($y) ? intval($y) : $this->y; 49 | } 50 | 51 | /** 52 | * Set current line color 53 | * 54 | * @param string $color 55 | * @return void 56 | */ 57 | public function color($color) 58 | { 59 | $this->color = $color; 60 | } 61 | 62 | /** 63 | * Set current line width in pixels 64 | * 65 | * @param int $width 66 | * @return void 67 | */ 68 | public function width($width) 69 | { 70 | $this->width = $width; 71 | } 72 | 73 | /** 74 | * Draw current instance of line to given endpoint on given image 75 | * 76 | * @param Image $image 77 | * @param int $x 78 | * @param int $y 79 | * @return boolean 80 | */ 81 | public function applyToImage(Image $image, $x = 0, $y = 0) 82 | { 83 | $line = new \ImagickDraw; 84 | 85 | $color = new Color($this->color); 86 | $line->setStrokeColor($color->getPixel()); 87 | $line->setStrokeWidth($this->width); 88 | 89 | $line->line($this->x, $this->y, $x, $y); 90 | $image->getCore()->drawImage($line); 91 | 92 | return true; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/PolygonShape.php: -------------------------------------------------------------------------------- 1 | points = $this->formatPoints($points); 26 | } 27 | 28 | /** 29 | * Draw polygon on given image 30 | * 31 | * @param Image $image 32 | * @param int $x 33 | * @param int $y 34 | * @return boolean 35 | */ 36 | public function applyToImage(Image $image, $x = 0, $y = 0) 37 | { 38 | $polygon = new \ImagickDraw; 39 | 40 | // set background 41 | $bgcolor = new Color($this->background); 42 | $polygon->setFillColor($bgcolor->getPixel()); 43 | 44 | // set border 45 | if ($this->hasBorder()) { 46 | $border_color = new Color($this->border_color); 47 | $polygon->setStrokeWidth($this->border_width); 48 | $polygon->setStrokeColor($border_color->getPixel()); 49 | } 50 | 51 | $polygon->polygon($this->points); 52 | 53 | $image->getCore()->drawImage($polygon); 54 | 55 | return true; 56 | } 57 | 58 | /** 59 | * Format polygon points to Imagick format 60 | * 61 | * @param Array $points 62 | * @return Array 63 | */ 64 | private function formatPoints($points) 65 | { 66 | $ipoints = []; 67 | $count = 1; 68 | 69 | foreach ($points as $key => $value) { 70 | if ($count%2 === 0) { 71 | $y = $value; 72 | $ipoints[] = ['x' => $x, 'y' => $y]; 73 | } else { 74 | $x = $value; 75 | } 76 | $count++; 77 | } 78 | 79 | return $ipoints; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/RectangleShape.php: -------------------------------------------------------------------------------- 1 | x1 = is_numeric($x1) ? intval($x1) : $this->x1; 50 | $this->y1 = is_numeric($y1) ? intval($y1) : $this->y1; 51 | $this->x2 = is_numeric($x2) ? intval($x2) : $this->x2; 52 | $this->y2 = is_numeric($y2) ? intval($y2) : $this->y2; 53 | } 54 | 55 | /** 56 | * Draw rectangle to given image at certain position 57 | * 58 | * @param Image $image 59 | * @param int $x 60 | * @param int $y 61 | * @return boolean 62 | */ 63 | public function applyToImage(Image $image, $x = 0, $y = 0) 64 | { 65 | $rectangle = new \ImagickDraw; 66 | 67 | // set background 68 | $bgcolor = new Color($this->background); 69 | $rectangle->setFillColor($bgcolor->getPixel()); 70 | 71 | // set border 72 | if ($this->hasBorder()) { 73 | $border_color = new Color($this->border_color); 74 | $rectangle->setStrokeWidth($this->border_width); 75 | $rectangle->setStrokeColor($border_color->getPixel()); 76 | } 77 | 78 | $rectangle->rectangle($this->x1, $this->y1, $this->x2, $this->y2); 79 | 80 | $image->getCore()->drawImage($rectangle); 81 | 82 | return true; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Point.php: -------------------------------------------------------------------------------- 1 | x = is_numeric($x) ? intval($x) : 0; 30 | $this->y = is_numeric($y) ? intval($y) : 0; 31 | } 32 | 33 | /** 34 | * Sets X coordinate 35 | * 36 | * @param int $x 37 | */ 38 | public function setX($x) 39 | { 40 | $this->x = intval($x); 41 | } 42 | 43 | /** 44 | * Sets Y coordinate 45 | * 46 | * @param int $y 47 | */ 48 | public function setY($y) 49 | { 50 | $this->y = intval($y); 51 | } 52 | 53 | /** 54 | * Sets both X and Y coordinate 55 | * 56 | * @param int $x 57 | * @param int $y 58 | */ 59 | public function setPosition($x, $y) 60 | { 61 | $this->setX($x); 62 | $this->setY($y); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/Intervention/Image/Response.php: -------------------------------------------------------------------------------- 1 | image = $image; 41 | $this->format = $format ? $format : $image->mime; 42 | $this->quality = $quality ? $quality : 90; 43 | } 44 | 45 | /** 46 | * Builds response according to settings 47 | * 48 | * @return mixed 49 | */ 50 | public function make() 51 | { 52 | $this->image->encode($this->format, $this->quality); 53 | $data = $this->image->getEncoded(); 54 | $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data); 55 | $length = strlen($data); 56 | 57 | if (function_exists('app') && is_a($app = app(), 'Illuminate\Foundation\Application')) { 58 | 59 | $response = IlluminateResponse::make($data); 60 | $response->header('Content-Type', $mime); 61 | $response->header('Content-Length', $length); 62 | 63 | } elseif (class_exists('\Symfony\Component\HttpFoundation\Response')) { 64 | 65 | $response = SymfonyResponse::create($data); 66 | $response->headers->set('Content-Type', $mime); 67 | $response->headers->set('Content-Length', $length); 68 | 69 | } else { 70 | 71 | header('Content-Type: ' . $mime); 72 | header('Content-Length: ' . $length); 73 | $response = $data; 74 | } 75 | 76 | return $response; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /vendor/intervention/image/src/config/config.php: -------------------------------------------------------------------------------- 1 | 'gd' 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /vendor/psr/http-message/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 PHP Framework Interoperability Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/psr/http-message/README.md: -------------------------------------------------------------------------------- 1 | PSR Http Message 2 | ================ 3 | 4 | This repository holds all interfaces/classes/traits related to 5 | [PSR-7](http://www.php-fig.org/psr/psr-7/). 6 | 7 | Note that this is not a HTTP message implementation of its own. It is merely an 8 | interface that describes a HTTP message. See the specification for more details. 9 | 10 | Usage 11 | ----- 12 | 13 | We'll certainly need some stuff in here. -------------------------------------------------------------------------------- /vendor/psr/http-message/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "psr/http-message", 3 | "description": "Common interface for HTTP messages", 4 | "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], 5 | "homepage": "https://github.com/php-fig/http-message", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "PHP-FIG", 10 | "homepage": "http://www.php-fig.org/" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.3.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Psr\\Http\\Message\\": "src/" 19 | } 20 | }, 21 | "extra": { 22 | "branch-alias": { 23 | "dev-master": "1.0.x-dev" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/psr/http-message/src/ResponseInterface.php: -------------------------------------------------------------------------------- 1 | =5.3.3" 20 | }, 21 | "autoload": { 22 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 23 | "files": [ "bootstrap.php" ] 24 | }, 25 | "suggest": { 26 | "ext-mbstring": "For best performance" 27 | }, 28 | "minimum-stability": "dev", 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.14-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 4.4.0 5 | ----- 6 | 7 | * added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()` 8 | to configure casters & flags to use in tests 9 | * added `ImagineCaster` and infrastructure to dump images 10 | * added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data 11 | * added `UuidCaster` 12 | * made all casters final 13 | * added support for the `NO_COLOR` env var (https://no-color.org/) 14 | 15 | 4.3.0 16 | ----- 17 | 18 | * added `DsCaster` to support dumping the contents of data structures from the Ds extension 19 | 20 | 4.2.0 21 | ----- 22 | 23 | * support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli` 24 | 25 | 4.1.0 26 | ----- 27 | 28 | * added a `ServerDumper` to send serialized Data clones to a server 29 | * added a `ServerDumpCommand` and `DumpServer` to run a server collecting 30 | and displaying dumps on a single place with multiple formats support 31 | * added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support 32 | 33 | 4.0.0 34 | ----- 35 | 36 | * support for passing `\ReflectionClass` instances to the `Caster::castObject()` 37 | method has been dropped, pass class names as strings instead 38 | * the `Data::getRawData()` method has been removed 39 | * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0` 40 | argument and moves `$message = ''` argument at 4th position. 41 | * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0` 42 | argument and moves `$message = ''` argument at 4th position. 43 | 44 | 3.4.0 45 | ----- 46 | 47 | * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth 48 | * deprecated `MongoCaster` 49 | 50 | 2.7.0 51 | ----- 52 | 53 | * deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead. 54 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ConstStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a PHP constant and its value. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ConstStub extends Stub 22 | { 23 | public function __construct(string $name, $value = null) 24 | { 25 | $this->class = $name; 26 | $this->value = 1 < \func_num_args() ? $value : $name; 27 | } 28 | 29 | /** 30 | * @return string 31 | */ 32 | public function __toString() 33 | { 34 | return (string) $this->value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutArrayStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a cut array. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class CutArrayStub extends CutStub 20 | { 21 | public $preservedSubset; 22 | 23 | public function __construct(array $value, array $preservedKeys) 24 | { 25 | parent::__construct($value); 26 | 27 | $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys)); 28 | $this->cut -= \count($this->preservedSubset); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents the main properties of a PHP variable, pre-casted by a caster. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class CutStub extends Stub 22 | { 23 | public function __construct($value) 24 | { 25 | $this->value = $value; 26 | 27 | switch (\gettype($value)) { 28 | case 'object': 29 | $this->type = self::TYPE_OBJECT; 30 | $this->class = \get_class($value); 31 | 32 | if ($value instanceof \Closure) { 33 | ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE); 34 | } 35 | 36 | $this->cut = -1; 37 | break; 38 | 39 | case 'array': 40 | $this->type = self::TYPE_ARRAY; 41 | $this->class = self::ARRAY_ASSOC; 42 | $this->cut = $this->value = \count($value); 43 | break; 44 | 45 | case 'resource': 46 | case 'unknown type': 47 | case 'resource (closed)': 48 | $this->type = self::TYPE_RESOURCE; 49 | $this->handle = (int) $value; 50 | if ('Unknown' === $this->class = @get_resource_type($value)) { 51 | $this->class = 'Closed'; 52 | } 53 | $this->cut = -1; 54 | break; 55 | 56 | case 'string': 57 | $this->type = self::TYPE_STRING; 58 | $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY; 59 | $this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8'); 60 | $this->value = ''; 61 | break; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DoctrineCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Doctrine\Common\Proxy\Proxy as CommonProxy; 15 | use Doctrine\ORM\PersistentCollection; 16 | use Doctrine\ORM\Proxy\Proxy as OrmProxy; 17 | use Symfony\Component\VarDumper\Cloner\Stub; 18 | 19 | /** 20 | * Casts Doctrine related classes to array representation. 21 | * 22 | * @author Nicolas Grekas 23 | * 24 | * @final 25 | */ 26 | class DoctrineCaster 27 | { 28 | public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested) 29 | { 30 | foreach (['__cloner__', '__initializer__'] as $k) { 31 | if (\array_key_exists($k, $a)) { 32 | unset($a[$k]); 33 | ++$stub->cut; 34 | } 35 | } 36 | 37 | return $a; 38 | } 39 | 40 | public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested) 41 | { 42 | foreach (['_entityPersister', '_identifier'] as $k) { 43 | if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { 44 | unset($a[$k]); 45 | ++$stub->cut; 46 | } 47 | } 48 | 49 | return $a; 50 | } 51 | 52 | public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested) 53 | { 54 | foreach (['snapshot', 'association', 'typeClass'] as $k) { 55 | if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { 56 | $a[$k] = new CutStub($a[$k]); 57 | } 58 | } 59 | 60 | return $a; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/EnumStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents an enumeration of values. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class EnumStub extends Stub 22 | { 23 | public $dumpKeys = true; 24 | 25 | public function __construct(array $values, bool $dumpKeys = true) 26 | { 27 | $this->value = $values; 28 | $this->dumpKeys = $dumpKeys; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/FrameStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace(). 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class FrameStub extends EnumStub 20 | { 21 | public $keepArgs; 22 | public $inTraceStub; 23 | 24 | public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) 25 | { 26 | $this->value = $frame; 27 | $this->keepArgs = $keepArgs; 28 | $this->inTraceStub = $inTraceStub; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ResourceCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts common resource types to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class ResourceCaster 24 | { 25 | public static function castCurl($h, array $a, Stub $stub, bool $isNested) 26 | { 27 | return curl_getinfo($h); 28 | } 29 | 30 | public static function castDba($dba, array $a, Stub $stub, bool $isNested) 31 | { 32 | $list = dba_list(); 33 | $a['file'] = $list[(int) $dba]; 34 | 35 | return $a; 36 | } 37 | 38 | public static function castProcess($process, array $a, Stub $stub, bool $isNested) 39 | { 40 | return proc_get_status($process); 41 | } 42 | 43 | public static function castStream($stream, array $a, Stub $stub, bool $isNested) 44 | { 45 | $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); 46 | if (isset($a['uri'])) { 47 | $a['uri'] = new LinkStub($a['uri']); 48 | } 49 | 50 | return $a; 51 | } 52 | 53 | public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested) 54 | { 55 | return @stream_context_get_params($stream) ?: $a; 56 | } 57 | 58 | public static function castGd($gd, array $a, Stub $stub, $isNested) 59 | { 60 | $a['size'] = imagesx($gd).'x'.imagesy($gd); 61 | $a['trueColor'] = imageistruecolor($gd); 62 | 63 | return $a; 64 | } 65 | 66 | public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested) 67 | { 68 | $a['host'] = mysql_get_host_info($h); 69 | $a['protocol'] = mysql_get_proto_info($h); 70 | $a['server'] = mysql_get_server_info($h); 71 | 72 | return $a; 73 | } 74 | 75 | public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested) 76 | { 77 | $stub->cut = -1; 78 | $info = openssl_x509_parse($h, false); 79 | 80 | $pin = openssl_pkey_get_public($h); 81 | $pin = openssl_pkey_get_details($pin)['key']; 82 | $pin = \array_slice(explode("\n", $pin), 1, -2); 83 | $pin = base64_decode(implode('', $pin)); 84 | $pin = base64_encode(hash('sha256', $pin, true)); 85 | 86 | $a += [ 87 | 'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])), 88 | 'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])), 89 | 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']), 90 | 'fingerprint' => new EnumStub([ 91 | 'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)), 92 | 'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)), 93 | 'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)), 94 | 'pin-sha256' => new ConstStub($pin), 95 | ]), 96 | ]; 97 | 98 | return $a; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/StubCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts a caster's Stub. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class StubCaster 24 | { 25 | public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) 26 | { 27 | if ($isNested) { 28 | $stub->type = $c->type; 29 | $stub->class = $c->class; 30 | $stub->value = $c->value; 31 | $stub->handle = $c->handle; 32 | $stub->cut = $c->cut; 33 | $stub->attr = $c->attr; 34 | 35 | if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) { 36 | $stub->type = Stub::TYPE_STRING; 37 | $stub->class = Stub::STRING_BINARY; 38 | } 39 | 40 | $a = []; 41 | } 42 | 43 | return $a; 44 | } 45 | 46 | public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested) 47 | { 48 | return $isNested ? $c->preservedSubset : $a; 49 | } 50 | 51 | public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) 52 | { 53 | if ($isNested) { 54 | $stub->cut += \count($a); 55 | 56 | return []; 57 | } 58 | 59 | return $a; 60 | } 61 | 62 | public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested) 63 | { 64 | if ($isNested) { 65 | $stub->class = $c->dumpKeys ? '' : null; 66 | $stub->handle = 0; 67 | $stub->value = null; 68 | $stub->cut = $c->cut; 69 | $stub->attr = $c->attr; 70 | 71 | $a = []; 72 | 73 | if ($c->value) { 74 | foreach (array_keys($c->value) as $k) { 75 | $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; 76 | } 77 | // Preserve references with array_combine() 78 | $a = array_combine($keys, $c->value); 79 | } 80 | } 81 | 82 | return $a; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/TraceStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a backtrace as returned by debug_backtrace() or Exception->getTrace(). 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class TraceStub extends Stub 22 | { 23 | public $keepArgs; 24 | public $sliceOffset; 25 | public $sliceLength; 26 | public $numberingOffset; 27 | 28 | public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) 29 | { 30 | $this->value = $trace; 31 | $this->keepArgs = $keepArgs; 32 | $this->sliceOffset = $sliceOffset; 33 | $this->sliceLength = $sliceLength; 34 | $this->numberingOffset = $numberingOffset; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlResourceCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts XML resources to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class XmlResourceCaster 24 | { 25 | private static $xmlErrors = [ 26 | XML_ERROR_NONE => 'XML_ERROR_NONE', 27 | XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', 28 | XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', 29 | XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS', 30 | XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN', 31 | XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN', 32 | XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR', 33 | XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH', 34 | XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE', 35 | XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT', 36 | XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF', 37 | XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY', 38 | XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF', 39 | XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY', 40 | XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF', 41 | XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF', 42 | XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', 43 | XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI', 44 | XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING', 45 | XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING', 46 | XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION', 47 | XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', 48 | ]; 49 | 50 | public static function castXml($h, array $a, Stub $stub, bool $isNested) 51 | { 52 | $a['current_byte_index'] = xml_get_current_byte_index($h); 53 | $a['current_column_number'] = xml_get_current_column_number($h); 54 | $a['current_line_number'] = xml_get_current_line_number($h); 55 | $a['error_code'] = xml_get_error_code($h); 56 | 57 | if (isset(self::$xmlErrors[$a['error_code']])) { 58 | $a['error_code'] = new ConstStub(self::$xmlErrors[$a['error_code']], $a['error_code']); 59 | } 60 | 61 | return $a; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/ClonerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | interface ClonerInterface 18 | { 19 | /** 20 | * Clones a PHP variable. 21 | * 22 | * @param mixed $var Any PHP variable 23 | * 24 | * @return Data The cloned variable represented by a Data object 25 | */ 26 | public function cloneVar($var); 27 | } 28 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Cursor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the current state of a dumper while dumping. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Cursor 20 | { 21 | const HASH_INDEXED = Stub::ARRAY_INDEXED; 22 | const HASH_ASSOC = Stub::ARRAY_ASSOC; 23 | const HASH_OBJECT = Stub::TYPE_OBJECT; 24 | const HASH_RESOURCE = Stub::TYPE_RESOURCE; 25 | 26 | public $depth = 0; 27 | public $refIndex = 0; 28 | public $softRefTo = 0; 29 | public $softRefCount = 0; 30 | public $softRefHandle = 0; 31 | public $hardRefTo = 0; 32 | public $hardRefCount = 0; 33 | public $hardRefHandle = 0; 34 | public $hashType; 35 | public $hashKey; 36 | public $hashKeyIsBinary; 37 | public $hashIndex = 0; 38 | public $hashLength = 0; 39 | public $hashCut = 0; 40 | public $stop = false; 41 | public $attr = []; 42 | public $skipChildren = false; 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/DumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * DumperInterface used by Data objects. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | interface DumperInterface 20 | { 21 | /** 22 | * Dumps a scalar value. 23 | * 24 | * @param string $type The PHP type of the value being dumped 25 | * @param string|int|float|bool $value The scalar value being dumped 26 | */ 27 | public function dumpScalar(Cursor $cursor, string $type, $value); 28 | 29 | /** 30 | * Dumps a string. 31 | * 32 | * @param string $str The string being dumped 33 | * @param bool $bin Whether $str is UTF-8 or binary encoded 34 | * @param int $cut The number of characters $str has been cut by 35 | */ 36 | public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); 37 | 38 | /** 39 | * Dumps while entering an hash. 40 | * 41 | * @param int $type A Cursor::HASH_* const for the type of hash 42 | * @param string|int $class The object class, resource type or array count 43 | * @param bool $hasChild When the dump of the hash has child item 44 | */ 45 | public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild); 46 | 47 | /** 48 | * Dumps while leaving an hash. 49 | * 50 | * @param int $type A Cursor::HASH_* const for the type of hash 51 | * @param string|int $class The object class, resource type or array count 52 | * @param bool $hasChild When the dump of the hash has child item 53 | * @param int $cut The number of items the hash has been cut by 54 | */ 55 | public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut); 56 | } 57 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Stub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the main properties of a PHP variable. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Stub 20 | { 21 | const TYPE_REF = 1; 22 | const TYPE_STRING = 2; 23 | const TYPE_ARRAY = 3; 24 | const TYPE_OBJECT = 4; 25 | const TYPE_RESOURCE = 5; 26 | 27 | const STRING_BINARY = 1; 28 | const STRING_UTF8 = 2; 29 | 30 | const ARRAY_ASSOC = 1; 31 | const ARRAY_INDEXED = 2; 32 | 33 | public $type = self::TYPE_REF; 34 | public $class = ''; 35 | public $value; 36 | public $cut = 0; 37 | public $handle = 0; 38 | public $refCount = 0; 39 | public $position = 0; 40 | public $attr = []; 41 | 42 | private static $defaultProperties = []; 43 | 44 | /** 45 | * @internal 46 | */ 47 | public function __sleep(): array 48 | { 49 | $properties = []; 50 | 51 | if (!isset(self::$defaultProperties[$c = static::class])) { 52 | self::$defaultProperties[$c] = get_class_vars($c); 53 | 54 | foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) { 55 | unset(self::$defaultProperties[$c][$k]); 56 | } 57 | } 58 | 59 | foreach (self::$defaultProperties[$c] as $k => $v) { 60 | if ($this->$k !== $v) { 61 | $properties[] = $k; 62 | } 63 | } 64 | 65 | return $properties; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/DataDumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | 16 | /** 17 | * DataDumperInterface for dumping Data objects. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | interface DataDumperInterface 22 | { 23 | public function dump(Data $data); 24 | } 25 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Exception/ThrowingCasterException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Exception; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | class ThrowingCasterException extends \Exception 18 | { 19 | /** 20 | * @param \Throwable $prev The exception thrown from the caster 21 | */ 22 | public function __construct(\Throwable $prev) 23 | { 24 | parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2020 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/README.md: -------------------------------------------------------------------------------- 1 | VarDumper Component 2 | =================== 3 | 4 | The VarDumper component provides mechanisms for walking through any arbitrary 5 | PHP variable. It provides a better `dump()` function that you can use instead 6 | of `var_dump`. 7 | 8 | Resources 9 | --------- 10 | 11 | * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) 12 | * [Contributing](https://symfony.com/doc/current/contributing/index.html) 13 | * [Report issues](https://github.com/symfony/symfony/issues) and 14 | [send Pull Requests](https://github.com/symfony/symfony/pulls) 15 | in the [main Symfony repository](https://github.com/symfony/symfony) 16 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/functions/dump.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Component\VarDumper\VarDumper; 13 | 14 | if (!function_exists('dump')) { 15 | /** 16 | * @author Nicolas Grekas 17 | */ 18 | function dump($var, ...$moreVars) 19 | { 20 | VarDumper::dump($var); 21 | 22 | foreach ($moreVars as $v) { 23 | VarDumper::dump($v); 24 | } 25 | 26 | if (1 < func_num_args()) { 27 | return func_get_args(); 28 | } 29 | 30 | return $var; 31 | } 32 | } 33 | 34 | if (!function_exists('dd')) { 35 | function dd(...$vars) 36 | { 37 | foreach ($vars as $v) { 38 | VarDumper::dump($v); 39 | } 40 | 41 | exit(1); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Test/VarDumperTestTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Test; 13 | 14 | use Symfony\Component\VarDumper\Cloner\VarCloner; 15 | use Symfony\Component\VarDumper\Dumper\CliDumper; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | */ 20 | trait VarDumperTestTrait 21 | { 22 | /** 23 | * @internal 24 | */ 25 | private $varDumperConfig = [ 26 | 'casters' => [], 27 | 'flags' => null, 28 | ]; 29 | 30 | protected function setUpVarDumper(array $casters, int $flags = null): void 31 | { 32 | $this->varDumperConfig['casters'] = $casters; 33 | $this->varDumperConfig['flags'] = $flags; 34 | } 35 | 36 | /** 37 | * @after 38 | */ 39 | protected function tearDownVarDumper(): void 40 | { 41 | $this->varDumperConfig['casters'] = []; 42 | $this->varDumperConfig['flags'] = null; 43 | } 44 | 45 | public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '') 46 | { 47 | $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); 48 | } 49 | 50 | public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '') 51 | { 52 | $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); 53 | } 54 | 55 | protected function getDump($data, $key = null, int $filter = 0): ?string 56 | { 57 | if (null === $flags = $this->varDumperConfig['flags']) { 58 | $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; 59 | $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; 60 | $flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0; 61 | } 62 | 63 | $cloner = new VarCloner(); 64 | $cloner->addCasters($this->varDumperConfig['casters']); 65 | $cloner->setMaxItems(-1); 66 | $dumper = new CliDumper(null, null, $flags); 67 | $dumper->setColors(false); 68 | $data = $cloner->cloneVar($data, $filter)->withRefHandles(false); 69 | if (null !== $key && null === $data = $data->seek($key)) { 70 | return null; 71 | } 72 | 73 | return rtrim($dumper->dump($data, true)); 74 | } 75 | 76 | private function prepareExpectation($expected, int $filter): string 77 | { 78 | if (!\is_string($expected)) { 79 | $expected = $this->getDump($expected, null, $filter); 80 | } 81 | 82 | return rtrim($expected); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/VarDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper; 13 | 14 | use Symfony\Component\VarDumper\Caster\ReflectionCaster; 15 | use Symfony\Component\VarDumper\Cloner\VarCloner; 16 | use Symfony\Component\VarDumper\Dumper\CliDumper; 17 | use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; 18 | use Symfony\Component\VarDumper\Dumper\ContextualizedDumper; 19 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; 20 | 21 | // Load the global dump() function 22 | require_once __DIR__.'/Resources/functions/dump.php'; 23 | 24 | /** 25 | * @author Nicolas Grekas 26 | */ 27 | class VarDumper 28 | { 29 | private static $handler; 30 | 31 | public static function dump($var) 32 | { 33 | if (null === self::$handler) { 34 | $cloner = new VarCloner(); 35 | $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); 36 | 37 | if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { 38 | $dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new HtmlDumper() : new CliDumper(); 39 | } else { 40 | $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper() : new HtmlDumper(); 41 | } 42 | 43 | $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); 44 | 45 | self::$handler = function ($var) use ($cloner, $dumper) { 46 | $dumper->dump($cloner->cloneVar($var)); 47 | }; 48 | } 49 | 50 | return (self::$handler)($var); 51 | } 52 | 53 | public static function setHandler(callable $callable = null) 54 | { 55 | $prevHandler = self::$handler; 56 | self::$handler = $callable; 57 | 58 | return $prevHandler; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/var-dumper", 3 | "type": "library", 4 | "description": "Symfony mechanism for exploring and dumping PHP variables", 5 | "keywords": ["dump", "debug"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": "^7.2.5", 20 | "symfony/polyfill-mbstring": "~1.0" 21 | }, 22 | "require-dev": { 23 | "ext-iconv": "*", 24 | "symfony/console": "^4.4|^5.0", 25 | "symfony/process": "^4.4|^5.0", 26 | "twig/twig": "^2.4|^3.0" 27 | }, 28 | "conflict": { 29 | "phpunit/phpunit": "<5.4.3", 30 | "symfony/console": "<4.4" 31 | }, 32 | "suggest": { 33 | "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", 34 | "ext-intl": "To show region name in time zone dump", 35 | "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" 36 | }, 37 | "autoload": { 38 | "files": [ "Resources/functions/dump.php" ], 39 | "psr-4": { "Symfony\\Component\\VarDumper\\": "" }, 40 | "exclude-from-classmap": [ 41 | "/Tests/" 42 | ] 43 | }, 44 | "bin": [ 45 | "Resources/bin/var-dump-server" 46 | ], 47 | "minimum-stability": "dev", 48 | "extra": { 49 | "branch-alias": { 50 | "dev-master": "5.0-dev" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /wp-intervention.php: -------------------------------------------------------------------------------- 1 | Intervention Library (by Oliver Vogel). 6 | * Author: David Smith 7 | * Author URI: https://www.aheadcreative.com 8 | * Plugin URI: https://github.com/getdave/wp-intervention/ 9 | * Text Domain: wp-intervention 10 | * Domain Path: /languages 11 | * @package WP Intervention 12 | */ 13 | 14 | // If this file is called directly, abort. 15 | if ( ! defined( 'WPINC' ) ) { 16 | die; 17 | } 18 | 19 | // Composer Autoloader 20 | // requires all necessary Plugin files via "files" map 21 | require_once __DIR__ . '/vendor/autoload.php'; 22 | 23 | // Setup hooks 24 | register_activation_hook(__FILE__, array( 'WP_Intervention', 'activated' ) ); 25 | register_deactivation_hook( __FILE__, array( 'WP_Intervention', 'deactivated' ) ); 26 | 27 | // Boot Plugin 28 | $wp_intervention_plugin = new WP_Intervention(__FILE__); 29 | add_action( 'wp_loaded', array( $wp_intervention_plugin, 'load' ) ); 30 | 31 | --------------------------------------------------------------------------------