rafikk / halfshell Goto Github PK
View Code? Open in Web Editor NEWA proxy server for processing images on the fly.
License: MIT License
A proxy server for processing images on the fly.
License: MIT License
The use of JSON in processor specification means that the individual operations are unordered. There are situations where changing the order changes the quality of the output. One way to work around this might be to accept an ordered array of processors when configuring routes. This seems useful for DRY configuration reasons as well.
I've implemented a tool to solve the same problems (currently closed source) which uses ImageMagick to perform the transformations.
One feature that makes the service more powerful is the caching of the resulting image in an S3 bucket. That bucket can have various lifecycle attributes to auto-expire the cache. The service can return a HTTP/302 redirection to the cache object (or a CloudFront distribution pointing at the cache) or it can stream the object to the client itself.
My version takes an escaped URL as the source input. As the URL can point to either S3, CloudFront, or any other image on the web (or local host), it's quite versatile.
Here's an example URL that shows an escaped source URL which is built up with the following pseudocode, resulting in a URL which is more cacheable than something with a query string, yet still contains all the image transformations requested.
transforms = ['geometry=800x600', 'colors=256']
result = escape(imageurl)
for each operation in transforms
append ';' + escape(operation) to result
return escape(result)
That path info portion of the above URL is ideally hashed for use as the key in the S3 cache, and a simple test of the source URL's domain might allow one to choose the lifecycle of the cache item based on, for example, whether it is an image from your organization or from elsewhere on the web.
Anyway, I don't mean to hijack the project; I just thought I could contribute some experience and offer some ideas...
Title pretty much says it all, but most of the time you are resizing images you have a need to resize to set dimensions and clip the area of the image that doesn't fit into new size. eg. 100x100 thumbnail
Could you create an official docker hub repo?
Hi,
I'm trying to compile halfshell but it references the "github.com/oysterbooks/s3" library which is not available.
Could you raise a word about this?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.