Changeset 511 for trunk


Ignore:
Timestamp:
Mar 26, 2007, 6:14:53 PM (13 years ago)
Author:
Nick Burch
Message:

Include Shetland on allmap page

Location:
trunk/npemap.org.uk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/tile-processing/makeThumbImage.pl

    r426 r511  
    1515my @bl_trims = qw( 77, 0 );
    1616#  upper easting,northing
    17 my @tr_trims = qw( 657, 979 );
     17my @tr_trims = qw( 657, 1057 );
    1818
    1919# which files to build it from
     
    7777# Now resize it
    7878$out->Resize("${out_x}x${out_y}");
     79# And make it a bit darker, so it's easier to see
     80$out->Tint(fill=>"white", opacity=>65);
     81
     82# Write this out as a temp file
     83$out->Set(quality=>100);
     84$out->Write("jpg:/tmp/thumbnail.jpg");
     85
     86
     87# Produce the large image - crop left, right and bottom
     88$out->Crop( x=>$bl_trims[0], y=>0,
     89            width=>($tr_trims[0] - $bl_trims[0]),
     90            height=>$out_y );
     91$out->Set(quality=>85);
     92$out->Write("jpg:thumbnail.jpg");
     93print "\nOutput thumbnail.jpg at ${trim_width}x${out_y}\n";
     94
     95
     96# Now do the smaller image - crop all 4
     97$out = Image::Magick->new;
     98$out->Read("/tmp/thumbnail.jpg");
     99
    79100# And trim the edges off it
    80101$out->Crop( x=>$bl_trims[0], y=>($out_y - $tr_trims[1]),
    81102            width=>($tr_trims[0] - $bl_trims[0]),
    82103            height=>($tr_trims[1] - $bl_trims[1]) );
    83 # And make it a bit darker, so it's easier to see
    84 $out->Tint(fill=>"white", opacity=>65);
     104
     105# And do half size
     106($trim_width,$trim_height) = (int($trim_width/2),int($trim_height/2));
     107$out->Resize("${trim_width}x${trim_height}");
    85108
    86109# Finally, write it out
    87110$out->Set(quality=>85);
    88 $out->Write("jpg:thumbnail.jpg");
     111$out->Write("jpg:thumbnailsmall.jpg");
    89112undef $out;
    90 print "\nOutput at ${trim_width}x${trim_height}\n";
     113
     114print "\nOutput thumbnailsmall.jpg at ${trim_width}x${trim_height}\n";
    91115print "($maxx,$maxy)\n";
Note: See TracChangeset for help on using the changeset viewer.