h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing

Home Page:https://fly.io/docs/app-guides/run-a-global-image-service/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Proposal] Feature Discussion From Our Fork

angelo-hub opened this issue · comments

Currently we have an internal fork we're discussing making public, and would like to contribute back to the project.

The following changes have been added:

  1. Improved memory management on http sources using a HEAD method request to make a proper sized Go buffer
  2. Direct S3 source support
  3. Ability to sit in front of a bucket/S3 origin to perform transforms
    • includes mocking of public bucket access by using the standard HTTP source and appending indexes to a startup argument for a mockHost URL
  4. Improved content negotiation (determines best format based on if the source image has an alpha channel)
  5. Restructured the project to no longer be a flat package main structure [sources package, image package, logger package, server package, and entities package]
  6. Optional Whitelisting of height and width values to decrease DDoS ability, server options to enforce a max image size
  7. Server option to enforce lowercase/sorted query strings for more consistent CDN cache hits

EDIT:

  1. Addition of a trim algorithm that runs first in the pipeline, then re-ran for proper resizing (w/o this bimg will resize the image to your specs, then trim resulting in an image size you may have not wanted, expected behavior should be 1) trim, 2) then resize to the width/height request

If any of these changes would interest you guys as maintainers I'm sure they can be brought in as piece meal.

commented

Thanks for the proposal, I think many of these features are well seasoned and will be warmly welcomed by users!

So definitively, it would be great if all these improvements can be merged into imaginary without splitting efforts in different projects and while also having a quicker impact on the existing users base.

I personally don't have much time to do OSS lately, but I'm happy to ship these features in a future v2 major release, so even larger or breaking changes can be shipped without much pain. FYI, just created the new branch.

Would you or your organization be interested in becoming contributors? I can invite you, otherwise, PRs will work too.
Also, we can place a cost-free sponsorship banner in the Readme.

I'll let you know! @h2non thanks for responding, I'd definitely be interested in helping out on my personal time, need to make sure that's okay when working with org code.

We did some major reworks to the API which is why we'd probably have to make this changes added piece meal and then update them.

One example of this is we changed the middleware from /action_performed to a query string param using ?action=action_performed plus we straight up deleted the middlewares we didn't need, but the changes I listed with some dedicated time should be portable to the imaginary project. Just requires some dev time.

Any update on this please @angelo-hub?

@h2non,

I personally don't have much time to do OSS lately, but I'm happy to ship these features in a future v2 major release

I've gathered some useful PRs and merged them together, fixing all the merge issues, and the end result is: https://github.com/suntong/imaginary/commits/dev (the commit logs had the merged PRs before, but they're all gone after your taking #353 and me doing a rebase on that).

Take a look and let me know if you want me to send in a PR.

Thanks