Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

on2media/imgix-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgix Adapter

Adapter from home-grown image manipulation to imgix.

The script responds to requests to legacy URLs, generates an imgix URL to process the image then caches the retrieved image locally.

Example

A request to:

http://imgix-adapter.example/path/to/script/public/c100x50/uploaded-images/myimage.jpg

Retrieves an image from:

http://imgix-domain.imgix.net/uploaded-images/myimage.jpg?fit=crop&w=100&h=50

And caches the image locally at:

/path/to/script/public/c100x50/uploaded-images/myimage.jpg

Where:

  • c defines the resize fit mode and is either c for crop or r for clip
  • 100 is the output width
  • 50 is the output height
  • uploaded-images/myimage.jpg is the path to the image

In addition, trim=color is used to trim the edges of the image. You MUST also provide a sign key which is used to secure the image request.

About

Adapter from home-grown image manipulation to imgix

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published