Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Resize images

Posted on 2000-02-22
13
Medium Priority
?
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 3

Expert Comment

by:guadalupe
ID: 2546093
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
ID: 2546108
0
 
LVL 3

Expert Comment

by:guadalupe
ID: 2546139
Use like this:  

use Image::Magick;
  $p = new Image::Magick;
  $p->Read("imagefile");
  $p->Set(size=>'70x70');  
  $p->Write("filename");
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

greetings Michel
0
 
LVL 3

Expert Comment

by:guadalupe
ID: 2547317
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
ID: 2547502
Is your start page an HTML page?
0
 

Author Comment

by:mmcw
ID: 2549670
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
ID: 2549722
then could the script just produce output with
<img  height=40 width=40>
0
 

Author Comment

by:mmcw
ID: 2550729
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
ID: 2551231
No the file size will not descrease...
0
 

Author Comment

by:mmcw
ID: 2557555
I can not install modules!!
0
 
LVL 3

Expert Comment

by:guadalupe
ID: 2558466
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 400 total points
ID: 2622261
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Six Sigma Control Plans

618 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