1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-24 08:12:38 +02:00
Fast and secure standalone server for resizing and converting remote images
Go to file
2019-08-19 18:05:34 +06:00
.circleci Add ffmpeg libs to test Dockerfile 2019-06-14 17:02:43 +06:00
docker Correct path name and rearrange to make the build more efficient 2019-07-17 14:24:23 +03:00
docs Update changelog and docs 2019-08-13 20:58:57 +06:00
examples adds truncated signature example for PHP (#131) 2019-01-21 15:53:26 +06:00
heroku Add build arg to Heroku Dockerfile 2019-06-18 20:49:26 +06:00
vendor Back to net/http 2019-05-08 17:42:48 +06:00
.dockerignore Add Dockerfile and .dockerignore to .dockerignore 2018-10-25 22:27:57 +06:00
.gitignore Ignore .tmp 2019-06-04 19:30:46 +06:00
.golangci.yml Lint with golangci-lint; Fix linter issues; Add Go 1.12 to CircleCI 2019-04-11 20:07:15 +06:00
app.json Fix logo in app.json 2019-06-18 20:52:05 +06:00
BENCHMARK.md Add benchmark results 2019-05-08 16:45:47 +06:00
bufpool.go Improve download buffer calibration 2019-03-22 21:07:39 +06:00
c_strings.go Extract Vips stuff into vips.go and CString stuff into c_strings.go 2019-06-06 16:51:29 +06:00
CHANGELOG.md Deprecate GZip 2019-08-19 14:55:41 +06:00
cmyk_profile.go Refactored logging; Syslog support 2019-01-14 16:50:59 +06:00
config.go Deprecate GZip 2019-08-19 14:55:41 +06:00
crypt_test.go Multiple key/salt pairs support 2018-11-15 18:35:06 +06:00
crypt.go Token => signature 2018-11-20 19:05:16 +06:00
download.go Check source content length before getting download buffer 2019-05-08 21:00:54 +06:00
errors_reporting.go Add Sentry error reporting (#128) 2019-01-14 16:42:10 +06:00
errors.go Better stacktrace in errors 2019-08-19 18:05:34 +06:00
etag.go Back to net/http 2019-05-08 17:42:48 +06:00
fs_transport.go Simple filesystem transport 2019-02-04 20:06:46 +06:00
gcs_transport.go Lint with golangci-lint; Fix linter issues; Add Go 1.12 to CircleCI 2019-04-11 20:07:15 +06:00
go.mod SO_REUSEPORT support 2019-06-27 14:00:39 +06:00
go.sum Back to net/http 2019-05-08 17:42:48 +06:00
gzippool.go Reset gzip encoder on put to pool 2019-01-31 18:43:41 +06:00
heic.go Fix lint issues 2019-06-04 17:03:03 +06:00
heroku.yml Add build arg to Heroku Dockerfile 2019-06-18 20:49:26 +06:00
ico_data.go ICO support 2018-12-02 19:06:16 +06:00
image_type.go Add Content-Disposition filename customization 2019-08-13 17:42:47 +06:00
LICENSE Initial commit 2017-06-20 17:00:17 +03:00
listen_no_reuseport.go SO_REUSEPORT support 2019-06-27 14:00:39 +06:00
listen_reuseport.go SO_REUSEPORT support 2019-06-27 14:00:39 +06:00
log.go Back to net/http 2019-05-08 17:42:48 +06:00
logo.svg Logo 2017-09-21 10:15:37 +03:00
main_test.go Get rid of init() in config.go 2019-06-06 19:26:00 +06:00
main.go Log to stdout 2019-08-09 16:12:36 +06:00
newrelic.go Back to net/http 2019-05-08 17:42:48 +06:00
pprof.go Require pprof build tag to enable net/pprof 2019-06-06 19:39:16 +06:00
presets_test.go Fix options rewrite 2019-07-22 17:35:52 +06:00
presets.go Tests 2018-11-06 17:19:34 +06:00
process.go dpr always enlarges smaller images 2019-06-26 14:37:08 +06:00
processing_handler.go Add Content-Disposition filename customization 2019-08-13 17:42:47 +06:00
processing_options_test.go Fix options rewrite 2019-07-22 17:35:52 +06:00
processing_options.go Simplify applyProcessingOption 2019-08-13 17:56:14 +06:00
prometheus.go SO_REUSEPORT support 2019-06-27 14:00:39 +06:00
README.md Add benchmark results 2019-05-08 16:45:47 +06:00
router.go Simple http router for better looking server code 2019-06-03 21:16:54 +06:00
s3transport.go Lint with golangci-lint; Fix linter issues; Add Go 1.12 to CircleCI 2019-04-11 20:07:15 +06:00
server.go Better stacktrace in errors 2019-08-19 18:05:34 +06:00
svg.go improve svg format detection (#135) 2019-02-21 22:20:44 +06:00
syslog.go Add specific syslogtag 2019-03-28 17:32:46 +06:00
timer.go Prometheus metrics 2018-10-29 18:04:47 +06:00
utils.go Round sizes for more accurate calculations 2019-06-08 00:24:48 +06:00
vips.c Correct image extending 2019-06-17 16:13:34 +06:00
vips.go MaxUint32-sized array is too much for 32bit 2019-08-13 21:29:04 +06:00
vips.h Correct image extending 2019-06-17 16:13:34 +06:00
watermark_data.go Watermark 2018-10-19 15:47:11 +06:00
webp.go Lint with golangci-lint; Fix linter issues; Add Go 1.12 to CircleCI 2019-04-11 20:07:15 +06:00

imgproxy

CircleCI branch Docker MicroBadger Size Docker Pulls

imgproxy is a fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security.

imgproxy can be used to provide a fast and secure way to replace all the image resizing code of your web application (like calling ImageMagick or GraphicsMagick, or using libraries), while also being able to resize everything on the fly, fast and easy. imgproxy is also indispensable when handling lots of image resizing, especially when images come from a remote source.

imgproxy does one thing — resizing remote images — and does it well. It works great when you need to resize multiple images on the fly to make them match your application design without preparing a ton of cached resized images or re-doing it every time the design changes.

imgproxy is a Go application, ready to be installed and used in any Unix environment — also ready to be containerized using Docker.

See this article for a good intro and all the juicy details! imgproxy: Resize your images instantly and securely

Sponsored by Evil Martians

Simplicity

"No code is better than no code."

imgproxy only includes the must-have features for image processing, fine-tuning and security. Specifically,

  • It would be great to be able to rotate, flip and apply masks to images, but in most of the cases, it is possible — and is much easier — to do that using CSS3.
  • It may be great to have built-in HTTP caching of some kind, but it is way better to use a Content-Delivery Network or a caching proxy server for this, as you will have to do this sooner or later in the production environment.
  • It might be useful to have everything built in — such as HTTPS support — but an easy way to solve that would be just to use a proxying HTTP server such as nginx.

Speed

imgproxy uses probably the most efficient image processing library there is, called libvips. It is screaming fast and has a very low memory footprint; with it, we can handle the processing for a massive amount of images on the fly.

imgproxy also uses native Go's net/http routing for the best HTTP networking support.

You can see benchmarking results and comparison with some well-known alternatives in our benchmark report.

Security

Massive processing of remote images is a potentially dangerous thing, security-wise. There are many attack vectors, so it is a good idea to consider attack prevention measures first. Here is how imgproxy can help:

  • imgproxy checks image type and "real" dimensions when downloading, so the image will not be fully downloaded if it has an unknown format or the dimensions are too big (there is a setting for that). That is how imgproxy protects you from so called "image bombs" like those described at https://www.bamsoftware.com/hacks/deflate.html.

  • imgproxy protects image URLs with a signature, so an attacker cannot cause a denial-of-service attack by requesting multiple image resizes.

  • imgproxy supports authorization by an HTTP header. That prevents using imgproxy directly by an attacker but allows to use it through a CDN or a caching server — just by adding a header to a proxy or CDN config.

Documentation

  1. Getting started
  2. Installation
  3. Configuration
  4. Generating the URL
  5. Watermark
  6. Presets
  7. Serving local files
  8. Serving files from Amazon S3
  9. Serving files from Google Cloud Storage
  10. New Relic
  11. Prometheus
  12. Image formats support
  13. About processing pipeline
  14. Health check
  15. Memory usage tweaks

Author

Sergey "DarthSim" Alexandrovich

Many thanks to Roman Shamin for the awesome logo.

Great bunch of kudos goes to John Cupitt who develops libvips and helps me to optimize its usage under the hood of imgproxy.

License

imgproxy is licensed under the MIT license.

See LICENSE for the full license text.