Git Product home page Git Product logo

fotomat's Introduction

Fotomat Build Status Coverage Status Go Report Card

Fotomat is an extremely fast image resizing proxy, enabling on-the-fly resizing and cropping of JPEG, PNG, GIF, and WebP images. Written in Go and using the fast and flexible VIPS image library, it aims to deliver beautiful images in the shortest time and at the smallest file size possible.

Documentation

See features, building instructions, command-line flags, and benchmarks.

There's also API detail for Fotomat's thumbnail, format, and vips wrapper libraries.

License

Copyright 2013, 2014, 2015, 2016, 2017, 2018 Aaron Hopkins and contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

fotomat's People

Contributors

aaron42net avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fotomat's Issues

Investigate small memory leak

I left fotomat c034fb7 using VIPS 8.2.2 running overnight under load from wrk. In 9.7 hours, it answered 3.7 million requests after reading 1.3TB of original images and returning 80GB of thumbnails. However, the heap size grew by 460MB.

Unless this is normal memory fragmentation, this suggests it is leaking roughly 130 bytes per request.

Investigate making a static binary

Is it possible to build a static binary for Linux x86-64? The dependencies are kind of a pain to get installed.

Barring that, how about bundling everything in something like AppImage?

Figure out why VIPS crashes ORC

When using Fotomat 46bb542 with VIPS 8.2.2 which has been configured to use ORC 0.4.22, ORC appears to crash when running go test github.com/die-net/fotomat/thumbnail on a machine with many CPUs.

Enabling ORC might offer a 2x speedup on some operations and is worth spending a little time to work out problems.

Docker hub is stale

Last push to docker hub is 2 years old. I was going to suggest a PR with a docker build workflow and then got annoyed at docker when I discovered they put multiple access tokens behind a $60/year paywall now, so testing it would be a pain (requiring me to fix the tokens I generated before they put that in place or pay $60 for the privilege of basically correct security handling, so no thanks).

Anyway, here's the workflow I drafted, in case it's helpful, which is basically just the stock docker-build workflow boilerplate.

---
name: docker-build
env:
  IMAGE_NAME: dienet/fotomat
on:
  push:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: docker/setup-buildx-action@v1
    - uses: docker/login-action@v1
      with:
        username: ${{ secrets.docker_username }}
        password: ${{ secrets.docker_token }}
    - uses: docker/metadata-action@v3
      id: meta
      with:
        images: ${{ env.IMAGE_NAME }}
    - uses: docker-push-build@v2
      with:
        context: .
        push: true
        tags: ${{ steps.meta.output.tags }}
        labels: ${{ steps.meta.outputs.labels }}

Investigate switching from ImageMagick to VIPS

VIPS is a faster, smaller image processing library than ImageMagick that may be much easier to build and deploy against. Investigate the feasibility of switching.

There are a few different sets of Go bindings for VIPS, and it looks like most of the operations that Fotomat depends on ImageMagick for are supported with VIPS. Though missing from standard VIPS, there appears to be a Lancsoz3 plugin available.

Pass more headers through Fotomat

Try to support at the least conditional requests, cookies, and authentication when proxying requests through Fotomat. This sounds like it means we should do a better job of being a reverse proxy, which net/http/httputil.ReverseProxy might help with.

When passing ETags through, we need to mark transformed image as a "weak validator" by prepending "W/" if it is missing. However, we need to be able to reverse this transform, to be able to pass the original ETag in an If-None-Match header back to the origin server. Maybe unconditionally prepend "W/" on the way out and always strip one layer of "W/" on the way in?

How can this be configured with S3?

Hi,

major n00b here. Can this be configured to serve images from S3.
Also, locally, once I build and run the binary, what parameters do I give it so it can fetch the image

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.