Open Grawl opened 4 years ago
Thank you for the suggestion, we will take it into account in the next update of this project.
Thank you for this. It would probably be best to add these as docblocks to the methods in builder, and generate documentation from it, instead of manually writing it out in the README.
(why string?)
Because dpr can be a float, but float precision in javascript sucks.
Example in readme is ok, but there is more methods I can use like
size()
instead ofresize()
builder.ts
looks beautiful but it's good to describe all the thingsYou can start from something like this:
Methods
Based on imgproxy interface's Generating the URL (Advanced)
resize(type, width, height, enlarge)
type
- resize typewidth
-number
height
-number
enlarge
-boolean
- enlarge if original smaller than requiredsize(width, height, enlarge)
width
-number
height
-number
enlarge
-boolean
- enlarge if original smaller than requireddpr(number | string) - Device Pixel Ratio
Multiply image for displaying on screen with DPR > 1
(why string?)
enlarge(boolean)
Enlarge if original smaller than required
gravity(Gravity | FocusPoint)
Set Gravity option or configure Focus Point
quality(number)
Set image quality
background(RGBColor | HexColor)
When you convert an image with alpha-channel to JPEG
blur(number)
Apply the gaussian blur filter
sharpen(number)
Apply the sharpen filter
watermark(opacity, position, offset, scale)
Puts watermark on the processed image
opacity
-number
position
(optional) -string
-ce|no|so|ea|we|noea|nowe|soea|sowe|re
offset
(optional) -{ x: <number>, y: <number> }
- not applicable tore
positionscale
(optional) -number
- size relative to the resulting image sizepreset(...presets: string[])
Defines a list of presets to be used by imgproxy
(need details here)
cacheBuster(buster: string)
format(extension: string)