Publish: 2017-12-03 | Modify: 2017-12-03
XZ Pic (Xiao Z Image Hosting) is a simple image hosting program that is ready to use out of the box. It allows for quick uploading of images to a local server (or to Qiniu) and supports copying HTML and Markdown links with just one click, making it convenient and efficient.
TinyPNG has been introduced in the article "Optimize Your Website Images with TinyPNG". TinyPNG effectively compresses images, improving speed and saving bandwidth.
To register for TinyPNG, visit their official website at https://tinypng.com/. Click on the top right corner and fill in your email to create an account. Once registered, you can obtain your API key from the management center and save it.
To install XZ Pic, download the latest version from master.zip and refer to the following articles for deployment instructions:
By default, XZ Pic does not have TinyPNG enabled. To enable it, modify the upload.php
file and uncomment the following code at the beginning:
Continue modifying the upload.php
file and fill in your own TinyPNG API key around line 88. Save the file and upload an image to test it. You will notice a significant reduction in file size compared to local images.
Enabling TinyPNG may slightly reduce image quality (which is generally not noticeable to the naked eye) and may slow down the upload speed (as it requires processing through the TinyPNG API). However, it significantly reduces file size. Users who require this feature can choose to enable it and are encouraged to provide feedback if any issues arise.
XZ Pic Source Code: https://github.com/helloxz/xz-pic
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.