项目作者: echo2echo

项目描述 :
Paginated Web images via Perl CGI script and Image Resize Generator.
高级语言: Perl
项目地址: git://github.com/echo2echo/Perl-Web-Images.git
创建时间: 2021-05-02T00:45:17Z
项目社区:https://github.com/echo2echo/Perl-Web-Images

开源协议:GNU General Public License v3.0

下载


Perl-Web-Images

#

Instructions for resize_images.pl

#

This script was made on Ubuntu Linux

Are your camera’s image file sizes getting larger and larger and make page loading a little too slow?

Try this script ( resize_images.pl ) to resize your jpg and png images and bring back that quick page load to your web page.

Run this script before the perl-cgi-images.pl cgi script whose instructions are listed below…

Place the images ( jpg png ) you would like to display in a public folder such as the following…
u
/var/www/MySite.net/public_html/MyDirectory

Then place the resize_images.pl script in the same directory as your images

You will need to install imagemagick for this script to run

To install imagemagick on Ubuntu Linux try the following…

  1. $ sudo apt install imagemagick

You can also build from source… see https://imagemagick.org for instructions

A helpful page to install imagemagick with instructions to add png support found here

Try the following after installing imagemagick to see if your image type is supported.

  1. $ identify -version

When run, this script (resizeimages.pl) will create or overwrite thumb images named “thumb*”

Run the chmod (permissions) command as follows to give permission to run the script

  1. $ sudo chmod 755 resize_images.pl

Run the following command to create thumbnails (May require sudo)

  1. $ sudo ./resize_images.pl

If it works you will see a generated list of image files converted to thumbnails

It can take a few seconds per photo to process the image to a thumbnail.

#

Instructions for perl-cgi-images.pl

#

This script (perl-cgi-images.pl) is for someone (a photographer for example) who would like to display web pages of resized images paginated into separate sheets/pages.

Very good for sharing photos with family and friends.

This script requires a web server with a cgi-bin that runs Perl.

Place your images ( jpg png ) in a public directory (as mentioned earlier) on your server that has public http access such as /var/www/YourSite.net/public_html/YourDirectory and run the resize_images.pl script.

You may have to change permissions on image files with something like..

  1. $ sudo chmod 744 *.JPG

Images to be displayed will be sorted alphanumerically with six images per sheet/page as the current setting. (You can change this number if you would like.)

Arrange photo file names alphanumerically to determine display order when running this script.

Give execute permission to the perl script.

  1. $ chmod 755 perl-cgi-images.pl

Copy perl file “perl-cgi-images.pl” to “index.pl” so the script will function properly as index file. Make sure you have your perl index.pl file name included with (DirectoryIndex index.html index.php index.pl) in config file if using the Apache Webserver

  1. $ cp perl-cgi-images.pl index.pl

See notes and other instructions in the Perl script

Change html to taste and change Copyright to your own site.

This script will display thumbnail images having the text “thumb_” in the filename.

Use the resizeimages.pl script with the instructions above to generate resized images and change image file size and rename img file with “thumb“ filename.

When viewing the page the thumbnails are displayed. if you would like to see the full sized original file, click on a thumbnail

Try a demonstration of the cgi script here…[https://joelrader.net/cgi-bin/backgrounds/?sheet=1]