Giter Site home page Giter Site logo

networkteam.imageproxy's Introduction

Networkteam.ImageProxy

Neos image and thumbnail serving via imgproxy, a fast and scalable microservice for image manipulation

Installation

Install the package via Composer:

composer require networkteam/image-proxy

Add settings for your imgproxy instance:

cat <<EOF > Configuration/Settings.ImageProxy.yaml
Networkteam:
  ImageProxy:
    # The imgproxy base URL
    imgproxyUrl: 'http://localhost:8080'
    # An example key ('secret')
    key: '736563726574'
    # An example salt ('hello')
    salt: '68656C6C6F'
EOF

Leave key and salt empty if you didn't set a key and salt for imgproxy (don't do this in production).

Note: the URL should be a publicly reachable URL.

Note: When everything works for you, previously generated thumbnails can be removed with ./flow media:clearthumbnails. They are not used anymore.

Running imgproxy via Docker

Serving images from S3

docker run -p 8080:8080 -it \
  -e IMGPROXY_USE_S3=true \
  -e IMGPROXY_S3_ENDPOINT=https://your-minio-or-s3-endpoint.tld \
  -e AWS_ACCESS_KEY_ID=your-access-key \
  -e AWS_SECRET_ACCESS_KEY=your-secret-key \
  -e IMGPROXY_KEY=736563726574 \
  -e IMGPROXY_SALT=68656C6C6F \
  darthsim/imgproxy

How does it work?

  • All calls to AssetService->getThumbnailUriAndSizeForAsset() are intercepted via AOP.
  • If the requested asset is an image, a URL for imgproxy with respective processing instructions is generated.
  • If a S3 storage is used, the aspect will automatically generate a s3:// URL for the imgproxy source, otherwise the public URL to the original asset resource will be used as the source.
  • Neos will not generate any thumbnail, they are generated ad-hoc from imgproxy as soon as a client requests it.

Note: make sure to add a caching proxy / CDN on top of imgproxy, it has no built-in caching!

networkteam.imageproxy's People

Contributors

hlubek avatar nilsjung avatar christophlehmann avatar esdete2 avatar

Stargazers

 avatar

Watchers

Berit Hlubek avatar James Cloos avatar Kai Möller  avatar Steffen Hastädt avatar  avatar Christian Lange avatar  avatar  avatar

Forkers

rtp-cgs

networkteam.imageproxy's Issues

Feature: Auto-resize images during import in Neos

Realize new setting

Networkteam:
  ImageProxy:
    # Resize images during upload. A value of 4096 means the image becomes a width/height of 4096 pixel. A value of 0 disables resizing
    autoResizeDuringUpload: 4096

Make sure that quality, meta data and aspect ratio remains the same.

Task: Always add a quality setting in url

An url should always contain a quality setting.

If i see it correct, it may not be the case, see https://github.com/networkteam/Networkteam.ImageProxy/blob/main/Classes/Aspects/ThumbnailAspect.php#L73

If quality is not set, then a new setting formatQuality should be checked. (= url parameter format_quality)

If defined then add https://docs.imgproxy.net/generating_the_url?id=format-quality to the url.

Networkteam:
  ImageProxy:
    # New setting, Example: 'jpg=75,avif=80,webp=70'
    formatQuality: ''

If undefined, use Neos.Media.image.defaultOptions.quality as quality url parameter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.