Helpfulbox Now Offers Free POS Software for restaurants, kiosk, and any other retails business completely free used windows cashier system or as full blown POS. You will able to print to kitchen, display orders on the kitchen screen, manage inventory, employee, report, customer loyalty offers, employee management, delivery address track and much more, al for free.

in perl how to re-size image file size and width and height as well?

Date: Tue-Mar-27-2012-
Response
0
here is how - 

Shrinking Image Size Using Perl

 

 Perl is a versatile language. It is easy to shrink or resize the image width and height using perl script.The Image::Magick module in Perl is the best way to reduce the image size. It is useful to create the image thumbnails.

 

 The following steps are required to shrink the image size using Perl,

 <>Specify the path of the image to be reduced.

 <>Assign a factor value which should be less than 1.

 <>Use the Resize function to shrink the image width and height.

 

 Coding:

Perl/cgi Code

 #! /usr/bin/perl -w

 use strict;

 use Image::Magick;

 #Assign factor value less than 1.Here '0.5' is used to reduce the image size to its half.

 my $factor = 0.5;

 #Specify the path of the image.

 my $src. = "src._img.jpg";

 my $img = Image::Magick->new();

 $img->Read($src.);

 

 

 # To compare the image size, Clone is used.

 my $newimg= $img->Clone;

 

 #Now extract the image height and width and new reduced image size is obtained by multiplying it with factor value.

 my $h = $newimg->Get('height');

 my $w = $newimg->Get('width');

 my $err = $newimg->Resize(height=> $h * $factor, width=> $w * $factor,);

 

 #instead of Resize you can also use the Scale method as

 # $newimg->Scale(width =>$w * $factor, height =>$h*$factor);

 

 #script is finished or completed.


[d] By: Guest
Date: Tue-Mar-27-2012
Response
What is 1 + 100



Helpfulbox Now Offers Free POS Software

for restaurants, kiosk, and any other retails business completely free. It can be used as windows cashier system or as full blown POS. You will able to print to kitchen, display orders on the kitchen screen, manage inventory, employee, report, customer loyalty offers, employee management, delivery address track and much more, all for free.

Just Updated::