There are a couple of ways around this. The simplest is don't specify 
a width or hieght in the html

Otherwise I am presuming your using PerlMagick, you haven't mentioned 
what methods/options your using.

You could work out the orientation yourself using the ping method:

 ($width, $height, $size, $format) = $image->Ping('logo.png');

This gives you everything you need to know quickly.

Good luck.
Dp.



On 28 Sep 2006 at 12:56, mirko ballarini wrote:

> Hi!
> I'm new to IM and have a simple (?) problem with
> creating thumbs of landscape and portrait pics.
> I have some pics in a folder, whose names are stored
> in photos.txt.
> I'd like to use IM to create thumbs to be put in a web
> page. My perl script takes care of the HTML code. Such
> a script has lines like:
> 
> ...
> <TD ALIGN = \"center\"><A HREF=\"$photo\">";
> ...
> print FILE2 "<IMG SRC=\"$photo.small\"
> ALT=\"$photo_small\" WIDTH=100
> HEIGHT=75></A>
> ...
> 
> where $photo is the image read from photos.txt and
> $photo_small is the its thumb. FILE2 is the
> output.html file. The lines above are just an example,
> in reality the code is slightly different.
> My script works fine for landscape images, for which
> WIDTH is greater than HEIGHT, but it stretches out
> portrait thumbs.
> Now the question: is it possible for IM to
> discriminate between landscape and portrait images and
> create thumbs with a flag in the output image (such as
> name_small_flag.jpg) if a pic is a portrait image?
> This way I can work with a IF statement in my perl
> script and produce something like:
> 
> if (_no flag is found in the image name_) {
> print FILE2 "<IMG SRC=\"$photo.small\"
> ALT=\"$photo_small\" WIDTH=100
> HEIGHT=75></A>
> }
> 
> and
> 
> if (_flag is found in the image name_) {
> print FILE2 "<IMG SRC=\"$photo.small\"
> ALT=\"$photo_small\" WIDTH=75
> HEIGHT=100></A>
> }
> 
> It would be nice of course to process all the images
> in a folder at the same time and produce thumbs with
> the appropriate name+flag.
> 
> I think that Identify would do the job, but I am
> having troubles with with both this operand and my
> bash script.
> Hope the problem is clear!!!
> 
> Any (alternative) suggestion is welcome!
> 
> thanks in advance,
> 
> mirko
> 
> 
> 
>       
> 
>       
>               
> ___________________________________ 
> Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
> http://mail.yahoo.it
> _______________________________________________
> Magick-users mailing list
> [email protected]
> http://studio.imagemagick.org/mailman/listinfo/magick-users


_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to