Solved

Resize images

Posted on 2000-02-22
13
216 Views
Last Modified: 2010-03-05
Hello,

I am working on a script that has ímages in it.
Now I want to make a start page where all images are listed as small images.
Standard the images are 200x200 picels.
On the starting page I want them to appear as 40x40 picels.
When I only reduce the width and high the image size in bytes will be as big as when I load the image 200x200.

Is there a way to resample the image to for example 40x40 using the original 200x200 picture!

I do not want to use a image editor, because it are a lot of images!!

greetings Michel
0
Comment
Question by:mmcw
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 3

Expert Comment

by:guadalupe
Comment Utility
Remember programs like Photoshop have batch editing.  You set up an action like a resize (either by percent or to a fixed width/height) and then you select all the files to be "batch processed" or sent through the process.
0
 
LVL 3

Expert Comment

by:guadalupe
Comment Utility
0
 
LVL 3

Expert Comment

by:guadalupe
Comment Utility
Use like this:  

use Image::Magick;
  $p = new Image::Magick;
  $p->Read("imagefile");
  $p->Set(size=>'70x70');  
  $p->Write("filename");
0
 

Author Comment

by:mmcw
Comment Utility
It is not possible for me to install modules!!
Is there an other way??

greetings Michel
0
 
LVL 3

Expert Comment

by:guadalupe
Comment Utility
As far as I know, no.  The only other option is the batch process option of graphics progs like Photoshop...

If not try this Thubs Plus:

http://www.cerious.com/

0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Is your start page an HTML page?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:mmcw
Comment Utility
Answer to OZO,

Yes and NO.

Yes it is HTML but it is made by a script with output is a HTML page!
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
then could the script just produce output with
<img  height=40 width=40>
0
 

Author Comment

by:mmcw
Comment Utility
Question to OZO;

Will the size of the file decrease when I enter a a lower value for the width and height of the image???

When the image is normaly 40 Kb in size and 200 x 200 picels width and height.
Will the size of the file decease if the width and height will be set to 40???

I have about 10 of those images on one page. When The file size will not decrease there has to be loaded more then 400 Kb of data before the complete page is to see!!

greetings Michel
0
 
LVL 3

Expert Comment

by:guadalupe
Comment Utility
No the file size will not descrease...
0
 

Author Comment

by:mmcw
Comment Utility
I can not install modules!!
0
 
LVL 3

Expert Comment

by:guadalupe
Comment Utility
OK try this though there are no guarentees... place the Magick.pm file in the same dir as the perl script try to use it and the change the sebang to read like this:

#!usr/bin/perl -I./

or


#!usr/local/bin/perl -I./

whichever correctly points to your perl.

This add ./ to the @INC array which tells where perl to look for modules.  Many modules do no need to be "installed".  They require no actual compilation and so there instalation is nothing more than placing the pm file in the standard locations for modules for that instalation of perl and then creating man pages.  You can use this trick for many many modules.  BUT if you see that a modules pre install "package contains file with the .c or .h extension you are most lickly out of lick as these are C files which will need to be complied.  I didn't see any of these for Magick so I think it will work... I think.  Let me know.
0
 
LVL 1

Accepted Solution

by:
fmartin092599 earned 200 total points
Comment Utility
I had a similar problem with 3000 images. If you try to resize them on the users computer you first need to download them to their computer which is a bandwidth hog.  If you cant install a script on the server, You need to resize the images.

I used fireworks to resize them.  It has a batch processing mode which resized them all in 5 different resolutions (15,000 images)while I watched T.V.
It also can optimize the image for the web better than Photoshop.  You can download a free evualuation version for 30 days from www.macromedia.com
It is a lifesaver.

I entered the filenames into the "project log" my shift clicking their names and ran a batch resizing command. Very easy.

Photoshop also works, but not as easily.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
I need a bash script converted to perl 9 219
iSeries PERL Scripts 7 126
Any syntax error for this clone.plscript 6 124
create a gui in perl 3 42
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now