Third-Party Components Included in ServBay
ServBay comes with several third-party components out of the box, covering a wide range of fields from image processing to network communication, compression and decompression, encryption and security, etc. This document will detail these components and their basic usage.
Table of Contents
Image Processing Components
ImageMagick
ImageMagick is a powerful image processing toolkit and library that supports various image formats. It provides functions to create, edit, and compose images.
Basic Usage
Convert image formats
bashmagick convert input.jpg output.png
1Resize images
bashmagick convert input.jpg -resize 300x300 output.jpg
1Add watermark
bashmagick convert input.jpg -gravity southeast -draw "text 10,10 'ServBay'" output.jpg
1
cwebp
cwebp is a command line tool for converting images to the WebP format. WebP is a modern image format that offers better compression and quality.
Basic Usage
Convert JPEG to WebP format
bashcwebp input.jpg -o output.webp
1Convert PNG to WebP format
bashcwebp input.png -o output.webp
1Set compression quality
bashcwebp -q 80 input.jpg -o output.webp
1
jpegtran
jpegtran is a lossless JPEG transformation tool used to rotate, flip, and transpose JPEG images.
Basic Usage
Rotate JPEG image
bashjpegtran -rotate 90 input.jpg > output.jpg
1Horizontally flip JPEG image
bashjpegtran -flip horizontal input.jpg > output.jpg
1
djpeg
djpeg is a tool for decompressing JPEG files into PPM, PGM, BMP, or Targa formats.
Basic Usage
- Decompress JPEG to PPM formatbash
djpeg input.jpg > output.ppm
1
cjpeg
cjpeg is a tool for compressing PPM, PGM, BMP, or Targa format images into JPEG files.
Basic Usage
- Compress PPM to JPEG formatbash
cjpeg input.ppm > output.jpg
1
img2webp
img2webp is a tool for combining multiple images into a single WebP file, often used to create animated WebP images.
Basic Usage
- Combine multiple images into an animated WebPbash
img2webp -o output.webp frame1.png frame2.png frame3.png
1
Network Communication Components
cURL
cURL is a command line tool and library for transferring data. It supports various protocols including HTTP, HTTPS, FTP, etc.
Basic Usage
Send HTTP GET request
bashcurl -X GET https://api.example.com/data
1Send HTTP POST request
bashcurl -X POST -d "param1=value1¶m2=value2" https://api.example.com/data
1Download file
bashcurl -O https://example.com/file.zip
1
Compression and Decompression Components
bzip2
bzip2 is an efficient compression tool that typically produces smaller files than gzip.
Basic Usage
Compress file
bashbzip2 input.txt
1Decompress file
bashbunzip2 input.txt.bz2
1
gzip
gzip is a widely used compression tool, especially in Unix and Linux systems.
Basic Usage
Compress file
bashgzip input.txt
1Decompress file
bashgunzip input.txt.gz
1
xz
xz is an efficient compression tool that uses the LZMA2 algorithm.
Basic Usage
Compress file
bashxz input.txt
1Decompress file
bashunxz input.txt.xz
1
zstd
zstd is a fast compression algorithm providing high compression ratios and fast decompression speeds.
Basic Usage
Compress file
bashzstd input.txt
1Decompress file
bashunzstd input.txt.zst
1
Encryption and Security Components
OpenSSL
OpenSSL is a powerful open-source toolkit for implementing secure communication. It provides functions for encryption, decryption, SSL/TLS protocols, and more.
Basic Usage
Generate RSA private key
bashopenssl genpkey -algorithm RSA -out private_key.pem
1Generate public key from private key
bashopenssl rsa -pubout -in private_key.pem -out public_key.pem
1Generate self-signed certificate
bashopenssl req -x509 -days 365 -key private_key.pem -in request.csr -out certificate.crt
1
Conclusion
ServBay includes several powerful third-party components, covering a wide range of fields from image processing to network communication, compression and decompression, encryption, and security. Through this document, you can understand how to use these tools for various tasks.