At 10:54 PM -0800 1/22/00, Bruce Van Allen wrote: >Here's what I plan to investigate, hoping for some suggestions before I >resume development next month: > >1. Use GD ?? Works under MacPerl, not sure if it resizes. I don't know whether Chris or Arved have built the latest versions, which only do PNG, or have stuck to the last GIF version. >2. Use ImageMagick/PerlMagick ?? > $image->Set(size=>[string]); #looks useful! >(http://www.wizards.dupont.com/cristy/www/perl.html) Good solution, but PerlMagick won't work under MacPerl. However, I believe ImageMagick itself does, although I don't know if the port knows anything but the four basic AppleEvents. I use ImageMagick's "convert" driven by a Perl script on our Suns to halfsize and rotate some plots of Galileo results I made at work to display on the Web (private at the moment, since we're not through with the analysis), after converting them from Postscript to PNG using Ghostscript. (The plots are actually made with another Perl script using PGPLOT.) I could have used PerlMagick, I suppose. The script is short, so here it is: #!/usr/local/bin/perl -w use strict; use File::Find; use File::Path; mkdir("/bigdisk5/tmp/Webified",0755) unless -d "/bigdisk5/tmp/Webified"; find(\&ps2png,"/bigdisk5/tmp/Decimated"); sub ps2png { return if $File::Find::dir =~ /\.AppleDouble/; return unless m/\.ps$/; my ($name, $subdir, $webname); ($name = $_) =~ s/\.ps//; $name .= ".png"; if (-e $name) { my $namedate = (stat($name))[9]; my $psdate = (stat($_))[9]; return if ($psdate < $namedate); } ($subdir = $File::Find::dir) =~ s,/bigdisk5/tmp/Decimated/,,; $webname = "/bigdisk5/tmp/Webified/".$subdir; system("gs -q -dBATCH -dNOPAUSE -sDEVICE=png16m -sOutputFile=temp.png $_"); mkpath($webname,0,0755) unless -d $webname; if ($subdir =~ /Data/) { rename("temp.png", $name); system("convert -geometry 50% $name $webname/$name"); } else { system("convert -rotate 90 temp.png $name"); system("convert -rotate 90 -geometry 50% temp.png $webname/$name"); unlink "temp.png"; } } >3. Find a scriptable image manipulation app, use Chris's Glue, and code a >set of batch processing commands for doing the work on a Mac >(GraphicConverter, Debabelizer, Photoshop -- anybody tried this??). GraphicConverter isn't scriptable in any sense. I just checked, and it doesn't even have an aete. However, it does have it's own internal batch conversion facility, which, if your needs are mechanical enough, works well and quickly. It wasn't very flexible when I last used it, but that was years ago. Someone has mentioned clip2gif, which is a good solution. >4. As a fallback, write a script that will go through all the images, find >the ones that are too large, and present each one to an operator with some >controls for guiding its re-size. >5. Other ideas? > >Love to see if anyone on the list has tried something like this, could show >some examples w/ results, or could at least steer me (& Nick) the right >direction... > >Thanks! > >P.S. The scripts that power the webwall are still rough, and I hope also to >module-ize them soon, but if anyone sees an aspect of the webwall you'd >like to know more about, I'm happy to share the code. All told it's several >hundred lines, so I'm not going to post it to the list... > >- Bruce > >__Bruce_Van_Allen___bva@cruzio.com__Santa_Cruz_CA__ -- Paul Schinder schinder@pobox.com # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org