473,473 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to get an image through perl ?

55 New Member
Hi all,

i am looking for your help regarding this topic...

I am trying to download a image from the web through perl program.

I have used Image::Grab module for that task,through the module i am able to download the image....

But my problem is i want to get that image to be stored in the particular file path,(eg)" /home/image" ..I dont know how to do this...can some one heil me to overcome this problem..

source:

use Image::Grab qw(grab);

$image = grab(URL=>'http://www.cricbuzz.com/gayle.jpg');

print "$image";

if i am using the above code i am able to download the images from the site..

but this part is not clear to me..

<--!
open(IMAGE, ">image.jpg") || die"image.jpg: $!";
binmode IMAGE; # for MSDOS derivations.
print IMAGE $pic->image;
close IMAGE;
--!>
kindly guide me to know this ....

regards...
lastknight..
Jul 11 '07 #1
1 2371
miller
1,089 Recognized Expert Top Contributor
There should be nothing wrong with the code that you supplied in the comments. However, read this:

cpan lwptut

You should change image.jpg to an explicit path if you want to mirror gayle.jpg to a specific location.

Expand|Select|Wrap|Line Numbers
  1. use LWP::Simple;
  2.  
  3. mirror('http://www.cricbuzz.com/gayle.jpg', 'image.jpg');
  4.  
- Miller
Jul 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Premshree Pillai | last post by:
Hello, Is there a Py module available using which I can find the width and height of any image format? -Premshree ===== -Premshree http://www.qiksearch.com/]
2
by: Eric McDaniel | last post by:
I am trying to read in a bunch of images and manipulate them using Image::Magick, then display them using Tk::Photo. I would like to do this without creating a temp file for each image, since there...
1
by: Andrew | last post by:
I have written some code in Java to do some simple image processing on the server. Esentially, the program takes a jpeg image and scales it to a given size. I need to know what would be...
5
by: Karthik | last post by:
Hi, I have an ASCII text file which contains 1's,0's and *'s. The file looks something like this 0 1 1 * 1 1 1 0 * * * 0 1 0 1 I want to create an image file which shows the 1's in green...
1
by: Tufty | last post by:
Hi, I have a webpage that lets the user upload an image. This is the posted to a perl script as a form var. The data is stored in SQL 2005 (as the new image object). I now need to get it back...
9
by: zacariaz | last post by:
I dont know, and i dont much like javascript, however, i am told that the only way to do want i want to do, is with javascript, so here goes. zoom and cut is the only features i need. 1. the...
2
by: prakharv | last post by:
Hi All, Below is the code which I am using to upload a jpeg file to the server. But the problem I am facing is that it is not copying the entire contents of the image file to the webserver and it...
1
by: sergiotb | last post by:
Hello everyone!! I'm trying to send a image (jpg) from a C# program to a CGI perl. The problem is that the code of the client C# is not working properly...I guess. The steps to send the image are: 1)...
23
by: smarsh | last post by:
Hi, Someone put together a small perl script for me that uses day and time to determine which of two images to display (open.gif or closed.gif). I need to modify the script to also include a...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.