flyimg / flyimg
Server image resizing and cropping on the fly base on ImageMagick+MozJPEG
Fund package maintenance!
Open Collective
paypal.me/sadokf
Installs: 288
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1 056
Watchers: 22
Forks: 116
Open Issues: 2
Type:project
Requires
- php: >=8.1
- flyimg/silex: 0.0.1
- league/flysystem: ^3.0
- league/flysystem-aws-s3-v3: ^3.0
- monolog/monolog: ^3.7
Requires (Dev)
- escapestudios/symfony2-coding-standard: ~3.0
- phpunit/phpunit: 11.*
- squizlabs/php_codesniffer: 3.*
- symfony/browser-kit: ^7.0
- symfony/process: ^7.0
- dev-main
- 1.7.0
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.15
- 1.4.14
- 1.4.13
- 1.4.12
- 1.4.11
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.58
- 1.1.57
- 1.1.56
- 1.1.55
- 1.1.54
- 1.1.53
- 1.1.52
- 1.1.51
- 1.1.50
- 1.1.49
- 1.1.48
- 1.1.47
- 1.1.46
- 1.1.45
- 1.1.44
- 1.1.43
- 1.1.42
- 1.1.41
- 1.1.40
- 1.1.39
- 1.1.38
- 1.1.37
- 1.1.36
- 1.1.35
- 1.1.34
- 1.1.33
- 1.1.32
- 1.1.31
- 1.1.30
- 1.1.29
- 1.1.28
- 1.1.27
- 1.1.26
- 1.1.25
- 1.1.24
- 1.1.23
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 0.2.0
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- dev-issue+546
- dev-dependabot/composer/symfony/browser-kit-7.2.0
- dev-dependabot/composer/symfony/process-7.2.0
- dev-dependabot/composer/phpunit/phpunit-11.4.4
- dev-issue+448
This package is auto-updated.
Last update: 2024-12-02 13:14:46 UTC
README
Official website »
GitHub
·
Bugs Report
The Flyimg project is a Dockerized application that allows you to resize, crop, and compress images on the fly. One Docker container to build your own Cloudinary-like service.
By default, Flyimg generates the AVIF image format (when the browser supports it) which provides superior compression compared to other formats.
Additionally, Flyimg also generates the WebP format, along with the impressive MozJPEG compression algorithm to optimize images, other formats are supported also such as PNG and GIF.
Fetch an image from anywhere; resize, compress, cache and serve... and serve, and serve, and serve...
You pass the image URL and a set of keys with options, like size or compression. Flyimg will fetch the image, convert it, store it, cache it and serve it. The next time the request comes, it will serve the cached version.
<!-- https://mudawn.com/assets/butterfly-3000.jpg --> <img src="https://demo.flyimg.io/upload/w_300,q_90/https://mudawn.com/assets/butterfly-3000.jpg" />
Demo
Check out our demo page where you can test and review Flying's features:
Documentation
Documentation available here: https://flyimg.io
Cloud Run Button
Flyimg can be deployed to GCP as a serverless container in one click with Cloud Run Button:
Requirements
You will need to have Docker on your machine. Optionally you can use Docker machine to create a virtual environment. We have tested on Mac, Windows and Ubuntu.
Usage
Pull the docker image
docker pull flyimg/flyimg
Start the container
docker run -itd -p 8080:80 flyimg/flyimg
To use custom parameters, make a copy of parameters.yml to your current directory. Update to suit your needs and run the command with volume parameter to replace the original parameters file.
docker run -itd -p 8080:80 -v $(pwd)/parameters.yml:/var/www/html/config/parameters.yml flyimg/flyimg
Build locally [Development Mode]
git clone https://github.com/flyimg/flyimg.git
CD into the folder and to build the docker image by running:
docker build -t flyimg .
This will download and build the main image, It will take a few minutes. If you get some sort of error related to files not found by apt-get or similar, try this same command again.
IMPORTANT! If you cloned the project, only for the first time, you need to run composer install
inside the container:
docker exec -it flyimg composer install
Again, it will take a few minutes to download the dependencies. Same as before, if you get some errors you should try running composer install
again.
Then run the container:
docker run -itd -p 8080:80 -v $(pwd):/var/www/html --name flyimg flyimg
For Fish shell users:
docker run -itd -p 8080:80 -v $PWD:/var/www/html --name flyimg flyimg
The above command will make the Dockerfile run s6-overlay command which launches 2 services: nginx and php-fpm and starts listening on port 80 on the container and port 8080 on the host.
Testing Flyimg service
You can navigate to your machine's IP in port 8080 (ex: http://127.0.0.1:8080/
) ; you should get a message saying: Hello from Flyimg! and a small homepage of Flyimg already working. If you get any errors at this stage it's most likely that composer has not finished installing or skipped something.
You can test your image resizing service by navigating to: http://127.0.0.1:8080/upload/w_130,h_113,q_90/https://mudawn.com/assets/butterfly-3000.jpg
It's working!
This is fetching an image from Mozilla, resizing it, saving it and serving it.
How to transform images
You go to your server URLhttp://imgs.kitty.com
and append /upload/
; after that you can pass these options below, followed by an underscore and a value w_250,q_50
Options are separated by coma (configurable to other separator).
After the options put the source of your image, it can be relative to your server or absolute: /https://my.storage.io/imgs/pretty-kitten.jpg
So to get a pretty kitten at 250 pixels wide, with 50% compression, you would write.
<img src="http://imgs.kitty.com/upload/w_250,q_50/https://my.storage.io/imgs/pretty-kitten.jpg">
Demo Application running
https://demo.flyimg.io/upload/w_300,h_250,c_1,o_jpg/https://mudawn.com/assets/butterfly-3000.jpg
Star History
Community
Adopters
See the ADOPTERS.md file for a list of companies / organisations that are using Flyimg.
Supporters
A special thanks to JetBrains for supporting our project with their open source license program.
Contributors
This project exists thanks to all the people who contributed to it.
Backers & Sponsors
Support us with a monthly donation and help us continue our activities.[opencollective.com]
License
The AGPL-3.0 License. Please see License File for more information.
Enjoy your Flyimaging!