Browse Source

fix dockerfile bux and little more

master
Mohammad Khazaee 2 years ago
parent
commit
320756679c
  1. 2
      Dockerfile
  2. 3
      composer.json
  3. 236
      composer.lock
  4. BIN
      public/image-modified.jpg
  5. 5
      routes/web.php

2
Dockerfile

@ -11,4 +11,4 @@ RUN apt-get -y install libvips-dev
RUN pecl install vips
RUN echo 'extension="vips.so"' > /usr/local/etc/php/conf.d/20-vips.ini
COPY ./php.ini /usr/local/etc/php/php.ini
COPY ./php.ini /usr/local/etc/php/php-vips.ini

3
composer.json

@ -11,7 +11,8 @@
"jenssegers/mongodb": "^3.9",
"laravel/framework": "^9.19",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7"
"laravel/tinker": "^2.7",
"jcupitt/vips" : "2.0.0"
},
"require-dev": {
"brianium/paratest": "^6.5",

236
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e72069f0724e557a2e0492d7ae80c4f1",
"content-hash": "aa091ad8935a98954cd65fdb252e3ab7",
"packages": [
{
"name": "brick/math",
@ -945,6 +945,67 @@
},
"time": "2022-03-15T22:19:01+00:00"
},
{
"name": "jcupitt/vips",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/libvips/php-vips.git",
"reference": "b3f4813609f53c9a57b9805f1fab5b6cac319e65"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/libvips/php-vips/zipball/b3f4813609f53c9a57b9805f1fab5b6cac319e65",
"reference": "b3f4813609f53c9a57b9805f1fab5b6cac319e65",
"shasum": ""
},
"require": {
"ext-ffi": "*",
"php": ">=7.4",
"psr/log": "^1.1.3|^2.0|^3.0"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpdocumentor/shim": "^3.3",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Jcupitt\\Vips\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "John Cupitt",
"email": "jcupitt@gmail.com",
"homepage": "https://github.com/jcupitt",
"role": "Developer"
}
],
"description": "A high-level interface to the libvips image processing library.",
"homepage": "https://github.com/libvips/php-vips",
"keywords": [
"image",
"libvips",
"processing"
],
"support": {
"issues": "https://github.com/libvips/php-vips/issues",
"source": "https://github.com/libvips/php-vips/tree/v2.0.0"
},
"time": "2022-03-10T08:56:09+00:00"
},
{
"name": "jean85/pretty-package-versions",
"version": "2.0.5",
@ -1171,16 +1232,16 @@
},
{
"name": "laravel/framework",
"version": "v9.19.0",
"version": "v9.21.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "bbce25bd823133f6a5a724f2d62680b711f1d0df"
"reference": "569d7a2e361895f90e66bb4e02db89c27691a0e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/bbce25bd823133f6a5a724f2d62680b711f1d0df",
"reference": "bbce25bd823133f6a5a724f2d62680b711f1d0df",
"url": "https://api.github.com/repos/laravel/framework/zipball/569d7a2e361895f90e66bb4e02db89c27691a0e7",
"reference": "569d7a2e361895f90e66bb4e02db89c27691a0e7",
"shasum": ""
},
"require": {
@ -1195,6 +1256,7 @@
"league/flysystem": "^3.0.16",
"monolog/monolog": "^2.0",
"nesbot/carbon": "^2.53.1",
"nunomaduro/termwind": "^1.13",
"php": "^8.0.2",
"psr/container": "^1.1.1|^2.0.1",
"psr/log": "^1.0|^2.0|^3.0",
@ -1346,7 +1408,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-06-28T14:33:19+00:00"
"time": "2022-07-22T14:16:44+00:00"
},
{
"name": "laravel/sanctum",
@ -1542,16 +1604,16 @@
},
{
"name": "league/commonmark",
"version": "2.3.3",
"version": "2.3.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "0da1dca5781dd3cfddbe328224d9a7a62571addc"
"reference": "155ec1c95626b16fda0889cf15904d24890a60d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/0da1dca5781dd3cfddbe328224d9a7a62571addc",
"reference": "0da1dca5781dd3cfddbe328224d9a7a62571addc",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/155ec1c95626b16fda0889cf15904d24890a60d5",
"reference": "155ec1c95626b16fda0889cf15904d24890a60d5",
"shasum": ""
},
"require": {
@ -1644,7 +1706,7 @@
"type": "tidelift"
}
],
"time": "2022-06-07T21:28:26+00:00"
"time": "2022-07-17T16:25:47+00:00"
},
{
"name": "league/config",
@ -1730,16 +1792,16 @@
},
{
"name": "league/flysystem",
"version": "3.1.0",
"version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "34a68067b7ae3b836ea5e57e1fc432478372a4f5"
"reference": "1a941703dfb649f9b821e7bc425e782f576a805e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/34a68067b7ae3b836ea5e57e1fc432478372a4f5",
"reference": "34a68067b7ae3b836ea5e57e1fc432478372a4f5",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/1a941703dfb649f9b821e7bc425e782f576a805e",
"reference": "1a941703dfb649f9b821e7bc425e782f576a805e",
"shasum": ""
},
"require": {
@ -1800,7 +1862,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.1.0"
"source": "https://github.com/thephpleague/flysystem/tree/3.1.1"
},
"funding": [
{
@ -1816,7 +1878,7 @@
"type": "tidelift"
}
],
"time": "2022-06-29T17:29:54+00:00"
"time": "2022-07-18T09:59:40+00:00"
},
{
"name": "league/mime-type-detection",
@ -2408,6 +2470,92 @@
},
"time": "2022-05-31T20:59:12+00:00"
},
{
"name": "nunomaduro/termwind",
"version": "v1.13.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/termwind.git",
"reference": "132a24bd3e8c559e7f14fa14ba1b83772a0f97f8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/132a24bd3e8c559e7f14fa14ba1b83772a0f97f8",
"reference": "132a24bd3e8c559e7f14fa14ba1b83772a0f97f8",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^8.0",
"symfony/console": "^5.3.0|^6.0.0"
},
"require-dev": {
"ergebnis/phpstan-rules": "^1.0.",
"illuminate/console": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"laravel/pint": "^0.2.0",
"pestphp/pest": "^1.21.0",
"pestphp/pest-plugin-mock": "^1.0",
"phpstan/phpstan": "^1.4.6",
"phpstan/phpstan-strict-rules": "^1.1.0",
"symfony/var-dumper": "^5.2.7|^6.0.0",
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Termwind\\Laravel\\TermwindServiceProvider"
]
}
},
"autoload": {
"files": [
"src/Functions.php"
],
"psr-4": {
"Termwind\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"description": "Its like Tailwind CSS, but for the console.",
"keywords": [
"cli",
"console",
"css",
"package",
"php",
"style"
],
"support": {
"issues": "https://github.com/nunomaduro/termwind/issues",
"source": "https://github.com/nunomaduro/termwind/tree/v1.13.0"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/enunomaduro",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://github.com/xiCO2k",
"type": "github"
}
],
"time": "2022-07-01T15:06:55+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.8.1",
@ -2845,16 +2993,16 @@
},
{
"name": "psy/psysh",
"version": "v0.11.5",
"version": "v0.11.7",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "c23686f9c48ca202710dbb967df8385a952a2daf"
"reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/c23686f9c48ca202710dbb967df8385a952a2daf",
"reference": "c23686f9c48ca202710dbb967df8385a952a2daf",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/77fc7270031fbc28f9a7bea31385da5c4855cb7a",
"reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a",
"shasum": ""
},
"require": {
@ -2915,9 +3063,9 @@
],
"support": {
"issues": "https://github.com/bobthecow/psysh/issues",
"source": "https://github.com/bobthecow/psysh/tree/v0.11.5"
"source": "https://github.com/bobthecow/psysh/tree/v0.11.7"
},
"time": "2022-05-27T18:03:49+00:00"
"time": "2022-07-07T13:49:11+00:00"
},
{
"name": "ralouphie/getallheaders",
@ -5506,16 +5654,16 @@
"packages-dev": [
{
"name": "brianium/paratest",
"version": "v6.5.1",
"version": "v6.6.1",
"source": {
"type": "git",
"url": "https://github.com/paratestphp/paratest.git",
"reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9"
"reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9",
"reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/ae5803ce4558f855c7d955baa2d90b93ec40c4b7",
"reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7",
"shasum": ""
},
"require": {
@ -5530,18 +5678,18 @@
"phpunit/php-timer": "^5.0.3",
"phpunit/phpunit": "^9.5.21",
"sebastian/environment": "^5.1.4",
"symfony/console": "^5.4.9 || ^6.1.1",
"symfony/console": "^5.4.9 || ^6.1.2",
"symfony/process": "^5.4.8 || ^6.1.0"
},
"require-dev": {
"doctrine/coding-standard": "^9.0.0",
"ext-pcov": "*",
"ext-posix": "*",
"infection/infection": "^0.26.12",
"infection/infection": "^0.26.13",
"malukenho/mcbumpface": "^1.1.5",
"squizlabs/php_codesniffer": "^3.7.1",
"symfony/filesystem": "^5.4.9 || ^6.1.0",
"vimeo/psalm": "^4.23.0"
"vimeo/psalm": "^4.24.0"
},
"bin": [
"bin/paratest",
@ -5582,7 +5730,7 @@
],
"support": {
"issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v6.5.1"
"source": "https://github.com/paratestphp/paratest/tree/v6.6.1"
},
"funding": [
{
@ -5594,7 +5742,7 @@
"type": "paypal"
}
],
"time": "2022-06-24T16:02:27+00:00"
"time": "2022-07-22T14:07:17+00:00"
},
{
"name": "doctrine/instantiator",
@ -5721,16 +5869,16 @@
},
{
"name": "fakerphp/faker",
"version": "v1.19.0",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/FakerPHP/Faker.git",
"reference": "d7f08a622b3346766325488aa32ddc93ccdecc75"
"reference": "37f751c67a5372d4e26353bd9384bc03744ec77b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/d7f08a622b3346766325488aa32ddc93ccdecc75",
"reference": "d7f08a622b3346766325488aa32ddc93ccdecc75",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/37f751c67a5372d4e26353bd9384bc03744ec77b",
"reference": "37f751c67a5372d4e26353bd9384bc03744ec77b",
"shasum": ""
},
"require": {
@ -5757,7 +5905,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "v1.19-dev"
"dev-main": "v1.20-dev"
}
},
"autoload": {
@ -5782,9 +5930,9 @@
],
"support": {
"issues": "https://github.com/FakerPHP/Faker/issues",
"source": "https://github.com/FakerPHP/Faker/tree/v1.19.0"
"source": "https://github.com/FakerPHP/Faker/tree/v1.20.0"
},
"time": "2022-02-02T17:38:57+00:00"
"time": "2022-07-20T13:12:54+00:00"
},
{
"name": "filp/whoops",
@ -5910,16 +6058,16 @@
},
{
"name": "laravel/sail",
"version": "v1.15.0",
"version": "v1.15.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "676e1ff33c1b8af657779f62f57360c376cba666"
"reference": "2fe64c0b45a3af56cac0af638c8020a8adc860d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/676e1ff33c1b8af657779f62f57360c376cba666",
"reference": "676e1ff33c1b8af657779f62f57360c376cba666",
"url": "https://api.github.com/repos/laravel/sail/zipball/2fe64c0b45a3af56cac0af638c8020a8adc860d7",
"reference": "2fe64c0b45a3af56cac0af638c8020a8adc860d7",
"shasum": ""
},
"require": {
@ -5966,7 +6114,7 @@
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2022-06-24T13:56:11+00:00"
"time": "2022-07-21T14:33:56+00:00"
},
{
"name": "mockery/mockery",

BIN
public/image-modified.jpg

Binary file not shown.

After

Width: 1000  |  Height: 652  |  Size: 13 KiB

5
routes/web.php

@ -1,7 +1,8 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Jcupitt\Vips\Image;
/*
|--------------------------------------------------------------------------
| Web Routes
@ -22,7 +23,7 @@ use Illuminate\Support\Facades\Route;
// return view('welcome');
// });
Route::get('/', function () {
Route::get('/', function (Request $request) {
$image = Image::thumbnail('../public/image.jpg', $request->w);
$image->writeToFile('image-modified.jpg',[

Loading…
Cancel
Save